mod_rewrite force to lower case

I dont believe this is possible, just asking for confirmation.  But if I want to make sure that all extensions, page names or folder names are all lower case that without listing each one out individually I cannot do it through Mod_Rewrite.  Is that true?
iceman19330Asked:
Who is Participating?
 
caterham_wwwConnect With a Mentor Commented:
If you can use the rules in your httpd.conf instead of .htaccess files, you could use an internal mapfunction (tolower).

If you don't have such access, you may want to ckeck for uppercase, rewrite to foo.php internally, using php functions (strtolower) to convert $_SERVER['REQUEST_URI'] to lowercase and issue a 301 redirect via the header() functions.
# httpd.conf
 
RewriteEngine on
RewriteMap lower int:tolower
RewriteRule [A-Z] ${lower:%{REQUEST_URI}} [R=301,L]
 
 
# alternate approach vis .htaccess
 
RewriteEngine on
RewriteRule [A-Z] /redirect.php?uri=%{REQUEST_URI} [L]

Open in new window

0
 
fosiul01Commented:
Hi

do you meant url case change ??? like all lower case

have a look this 2 , if you meant something like this

http://www.codingforums.com/archive/index.php/t-156017.html
http://www.webmasterworld.com/forum92/1549.htm

0
 
iceman19330Author Commented:
Like /Product-blah.html to /product-blah.html but dynamically, because i dont want to have to write a rule for each case.  The other one was if it was product.HTML or Product.HTML to product.html, also doing that dynamically.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.