Make php URLs in Apache no longer case sensitive

Source: Internet
Author: User
Tags speling
: This article mainly introduces how to make php URLs in Apache not case sensitive. For more information about PHP tutorials, see. The Apache server in Linux is case-sensitive by default. if you do not have a matching php url, it cannot be opened. it is inconvenient to enter the url during the test and is unfriendly to search engines. How can this problem be solved? That is to say, when users enter uppercase letters, they will also jump to the lower-case URL page. Minimize the impact of capital. The specific solution is as follows. for example, Debian and other systems are similar to the following:

All of the following operations require the root permission of sudo.

1. locate speling. load in the path/etc/apache2/mod-available and copy it to the path/etc/apache2/mod-enabled:


2. write the speling. conf file to the/etc/apache2/mod-enabled Directory. the speling. conf content is very simple. I only write one line: CheckSpelling on

Remember to have sudo before the creation. if there is no graphic interface, use vi to play. for details, see [Linux] vi/vim usage (click to open the link)


3. add speling. load and speling. conf to/etc/apache2/mod-enabled, and restart apache. For example, we have configured a test in var/www. php does not have Test. php. obtain the Ubuntu IP address of the VM from the ifconfig on an external client, which is case-insensitive and can also access the test. php



In addition, some Linux systems, such as some CentOS php directory layout are different. you can use the following methods:

1. check whether there is no module mod_speling.so in the system. path:/etc/httpd/modules. if there is a module, directly pass the module. if there is a module, the system does not use it from another place.

2. Edit this module: vi/etc/httpd/conf/httpd. conf. in the module loading area, add the following content:

LoadModule speling_module modules/mod_speling.soCheckSpelling on

Save the changes and exit.

3. restart the httpd service.

The above describes how to make php URLs in Apache no longer case sensitive, including content, and hope to be helpful to friends who are interested in PHP tutorials.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.