Case sensitive, sometimes inconvenient, must be written accurately to access, not very friendly to search engines and users. .
The main reason for this phenomenon is the lack of the spelling module, so it only needs to be loaded in the corresponding system.
1. Debian system
It’s relatively simple under debian system
1. Find speling.load from the path /etc/apache2/mods-available and copy it to the path /etc/apache2/mods-enabled
2. Write the file spelling.conf to the directory /etc/apache2/mods-enabled
The content of speling.conf is very simple. All I wrote is the following line:
CheckSpelling on
3. After adding speling.load and speling.conf to /etc/apache2/mods-enabled, just restart apache
2. CentOS system
It's a little troublesome under centos system.
1. Check whether the system has the module mod_speling.so, path: /etc/httpd/modules; if there is, just pass it directly. If you don’t download it from elsewhere, use it
2. Load this module
vi /etc/httpd/conf/httpd.conf
In the module loading area, add the following line:
LoadModule speling_module modules/mod_speling.so
CheckSpelling on
Save changes and exit
3. Restart the httpd service
Apache can also be used like this: the idea is to write the code into the 404 page (404.php), and then the server will convert all the requested URLs into lowercase. After the conversion, if it can be found, it will jump to a new page, but it still cannot be found. Just return to the homepage.
Reposted from: http://www.ithr.org.cn/blogs/blog1.ph...
Case sensitive, sometimes inconvenient, must be written accurately to access, not very friendly to search engines and users. .
The main reason for this phenomenon is the lack of the spelling module, so it only needs to be loaded in the corresponding system.
1. Debian system
It’s relatively simple under debian system
1. Find speling.load from the path /etc/apache2/mods-available and copy it to the path /etc/apache2/mods-enabled
2. Write the file spelling.conf to the directory /etc/apache2/mods-enabled
The content of speling.conf is very simple. All I wrote is the following line:
CheckSpelling on
3. After adding speling.load and speling.conf to /etc/apache2/mods-enabled, just restart apache
2. CentOS system
It's a little troublesome under centos system.
1. Check whether the system has the module mod_speling.so, path: /etc/httpd/modules; if there is, just pass it directly. If you don’t download it from elsewhere, use it
2. Load this module
In the module loading area, add the following line:
LoadModule speling_module modules/mod_speling.so
CheckSpelling on
Save changes and exit
3. Restart the httpd service
If you are using Apache, you can use RewriteMap in mod_rewrite. Add this:
Apache can also be used like this: the idea is to write the code into the 404 page (404.php), and then the server will convert all the requested URLs into lowercase. After the conversion, if it can be found, it will jump to a new page, but it still cannot be found. Just return to the homepage.
Note: 1. Author of this code: hyperjiang URL: http://hi.baidu.com/frag/blog/item/52...
PS, I have not tested this code.
However, I sincerely recommend that you use lowercase for new URLs, and you can use rewrite for old URLs.
If it is an nginx server, just use perl_set
‘Unfriendly to search engines’?
Are you talking about Baidu’s case-insensitive search engine?
Always lowercase. Capitalization in URLs is no longer friendly.