views:

555

answers:

2

I need to make accessing directories on my server case insensitive.

How do I do that using htaccess?

+1  A: 

You have to install and enable the mod_speling module in apache and set the CheckCaseOnly Directive to On in your .htaccess

CheckCaseOnly On
agent0074
mod_speling or mod_spelling?
Malfist
ironic.agent0074, is mod_spelling not enabled by default? I have a shared hosting account, so I don't have access to changing Apache modules.
ycx
@ycx: Looks like it is disabled by default. http://httpd.apache.org/docs/2.2/mod/mod_speling.html
gameover
It's really called "mod_speling" http://httpd.apache.org/docs/2.2/mod/mod_speling.htmlIf it's enabled by default depends on your shared hosting provider, but don't think so, because it slows the server down a bit.
agent0074
I can't enable mod_speling.Is there not a Regex logic I can use?
ycx
A: 

This is what I used because my hosting is shared and does not include the mod_spelling module but does support .htaccess, but this only works for one folder:

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

The folder to redirect to can be any case, so you could use lower-case folders and redirect all variations of spelling there.

I suppose it could be adapted with a little bit of REGEX to work for all folders rather than just one. This worked for me on Apache 2.2.14 (Unix).

Tom