Make folders in Apache Case Insensitive using .htaccess

I need to make case-sensitive access to directories on my server.

How to do this using htaccess?

+3
source share
3 answers

You need to install and enable the mod_speling module in apache and set the CheckCaseOnly directive to On in .htaccess

CheckCaseOnly On
+3
source

If you want the requested URLs to be valid, whether uppercase or lowercase letters are used, use mod_speling to make the URLs case insensitive. Write the following code in the .htaccess file:

CheckSpelling On
+2
source

, , mod_spelling, .htaccess, :

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^student-government/$ http://www.tombarrasso.com/Student-Government/ [R=302,NC,L]

The redirection folder can be anyway, so you can use lowercase folders and redirect all spelling options there.

I assume that it can be adapted with a small amount of REGEX to work for all folders, not just one. This worked for me on Apache 2.2.14 (Unix).

0
source

Source: https://habr.com/ru/post/1727650/


All Articles