Filed Under: ModRewrite

Rewrite uppercase URL’s to lowercase

20 October 2008 No Comment

Well today I had to rewrite some URL’s from upper to lower-case letters. Somehow it did not rewrite this automatically. I didn’t figure out the reason why it did not work properly but I found a workaround.

If you have access to the httpd.conf file of the apache server, then simply add the following lines:

<VirtualHost IP:80>
 
   stuff here
 
   <IfModule mod_rewrite.c>
   RewriteEngine on
   rewritemap lowercase int:tolower
   RewriteCond $1 [A-Z]
   RewriteRule ^/(.*)$ /${lowercase:$1} [R=301,L] 
   </IfModule>

Now it will redirect the URL’s properly. Yay!
Source







Like our posts? Then subscribe via Mail:

Email:  

Similar Posts:

Socialize:

delicious stumbleupon

Leave your response!

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.com.