Hi,
I searched the topics here and did not see this posted, and haven’t found an obvious solution on Google… it is bugging the heck out of me!
I have a situation where there is capitalization in URLs, and people are linking to them with mixed case URLs or people are typing it in the address bar directly.
There are thousands so I need to handle this in some sort of rewrite.
The first thing to try is an Apache module named mod_spelling which corrects capitalization errors and minor typos. It’s NOT enabled by default but you could ask your host to enable it for you.
Lacking that, you could use mod_rewrite to find and replace every uppercase letter by its lower case equivalent - a nasty prospect at best. You can get sample code from my signature’s tutorial that will help you with that.
Whoops! You’re using mixed case file names? Horrors! If that’s the case, you’ll need the same “Poor Man’s RewriteMap” I just responded about in another thread but have it read the {REQUEST_FILENAME}, convert it to lower (or upper) case then, using an array for the required redirection, redirect to the CaMeL case you’re using.
Steve,
The No Case flag works to MATCH CaMeL case (useful in your example with the {HTTP_HOST} but it will not change the case as Jim is requesting (of the {REQUEST_URI}). RewriteMap’s %[tolower] will do that (change all to lower, not guess where the CaMeL is ) but I believe that you can’t even use %[tolower] without enabling it in the httpd.conf.