Forum Moderators: phranque

Message Too Old, No Replies

URL capitalisation fix for beginner

URL capitalisation fix for beginner how to fix this problem

         

GF_Diablos

10:24 am on Aug 16, 2007 (gmt 0)

10+ Year Member



Hey Guys,

First I apologise if this is a constantly repeated thread but I couldn’t find a solution by searching 

I need to set up my htaccess to solve the problem of capitalisation in urls so that mysite.com/pAGe.html goes to mysite.com/page.html but have no idea what I’m doing with this.

Can anyone give me a simple copy and paste solution here or is that not possible?

Thanks

g1smd

4:57 pm on Aug 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you looking for a rewrite, or a redirect?

The distiction is important.

A rewrite will cause infinite Duplicate Content.

A redirect will only allow the canonical form to be indexed.

The correct specification is for that URL to serve "404 Not Found" if the URL is really supposed to be all lower case for example.

jdMorgan

5:15 pm on Aug 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem is fairly easy to fix if you have access to httpd.conf, conf.d, or one of the other configuration-level files: Use RewriteMap to call the system-internal "tolower" function.

If you don't have config-level access, then the problem is difficult and very inefficient to fix; It requires about 29 RewriteRule code lines in a row -- 26 for each individual capital letter, plus a few overhead rules to implement recursion and prevent running all the code unless it is really necessary.

What level of access do you have?

Jim