Forum Moderators: phranque
You can use mod_speling to correct *one* incorrect character. Using this module is rather slow.
You can use a recursive mod_rewrite routine to correct case errors, but this is even slower (horribly slow).
Neither of these is a good solution if you get a lot of incorrect-case requests.
If you have access to httpd.conf, you can use a RewriteMap to call the system toupper or tolower functions. This is much better, efficiency-wise.
Jim
Never done it, but it seems like it should work. It would also only have to run when a page isn't found instead of for every page.
- Ryan
However, you should never use a 404 error-handler for this purpose, because the 404 response must not be made visible to the client (you can damage your search engine rankings badly if you allow the client to see a 404).
Instead, it would be better to either detect a missing file using mod_rewrite (See RewriteCond -f flag) or detect the uppercase characters, and then do an internal rewrite to the script.
Jim
On mixed case: If you don't have too many files, it may be possible to loop through files and compare case insensitivly (sp). Of course, with too many files this may be too intensive to be practical. Maybe a 404 w/ just a site map would be best for that.
- Ryan