Forum Moderators: phranque

Message Too Old, No Replies

.htaccess change case

         

zyron

11:12 am on Jun 27, 2005 (gmt 0)

10+ Year Member



Hi!

I have this in my .htaccess:
RewriteCond %{HTTP_HOST} (www\.)?web(.*).com$
RewriteCond /home/www/%2 -d
RewriteRule (.*)$ %2/index.php [L,QSA]

works fine on IE and firefox, but Lynx doesn't transform URL with caps to small letters.

so, can I transform all caps to small letters with something like this?
s/[A-Z]/[a-z]/g

but where do I put it?

Cheers
Lars

gergoe

3:53 pm on Jun 27, 2005 (gmt 0)

10+ Year Member



Use the NC flag for your RewriteRule and for the first RewriteCond as well. This tells mod_rewrite to ignore the case when applying the regex patterns. See the mod_rewrite documentation [httpd.apache.org] for further details.

zyron

7:20 am on Jun 29, 2005 (gmt 0)

10+ Year Member



Thanks for the reply Gergoe!

But NC doesn't working in this case.
I tested it.

I would work for

webabc
and
Webabc
even
WEBabc,
but not
webABC

Any other ideas?

Cheers
Lars