Msg#: 4304536 posted 7:19 am on May 3, 2011 (gmt 0)
You can redirect any request with one or more upper-case characters using mod_rewrite in .htaccess, but it is far easier to do it using PHP. Here's a rough idea as to what to do.
The upper-case "hook" in .htaccess should be one of the very first rules:
RewriteRule [A-Z]+ /my-special-script.php [L]
This is one of the rare occasions where a rewrite will be listed in .htaccess BEFORE the redirects. Normally we would want to avoid that, with rewrites AFTER redirects. However, when the PHP script is going to do all the work, the rewrite must be right at the beginning of all of the rules.
The chunk of PHP code that fixes the URL and sends the redirect response looks like this:
The above PHP code might have some syntax errors in it, but that's the basic start.
You can do any test and any manipulation you like in the PHP code. It's one of the few occasions when it is better to do the work in PHP, not in .htaccess.
The other redirects should be done in .htaccess but only for lower case URLs. Upper case URLs will be detected and fixed up by the PHP script because the upper-case-detecting-rule is the first rule in the .htaccess file.
At this point I am also going to recommend that you completely ditch extensions for HTML pages (you need to keep them for images, and stylesheets) and go extensionless. It makes working with .htaccess, and rewrites and redirects in general, even easier.