Uppercase links to lowercase

driveflexfuel

New Member
Messages
159
Reaction score
0
Points
0
The first version of my site had some directories and files that contained Capital letters. The new site contains all lowercase letters. I am looking for a way besides a using a huge list in my .htaccess file.

Is it possible to use a rewrite or to make capital an lowercase the same link such as

www.site.com/store/index.php
and
www.site.com/Store/Index.php
are the same.
 

vol7ron

New Member
Messages
434
Reaction score
0
Points
0
what do you want the desired effect to be? you can change the URL easily, but are you trying to change the HTML code?

use the [NC] RewriteRule flag to make things case insensitive


Or possibly, could this work for you:

RewriteEngine on
RewriteMap u2l int:tolower
RewriteRule ^/(.*)$ /${u2l:$1}
 
Last edited:

driveflexfuel

New Member
Messages
159
Reaction score
0
Points
0
Ill use this directory as an example

I have a list of vehicle files such as
/vehicles/Ford.php
/vehicles/Chevrolet.php

These are now
/store/vehicles/ford.php
/store/vehicles/chevrolet.php

I used the 301 redirect to point the vehicles directory to the proper location but i do not want to create a redirect for the 120 manufacturers. This is not the only directory that has gone from uppercase to lowercase. And the new site is dependent on lowercase links in the php coding.

I am not the best at working with htaccess so an example would be greatly appreciated.
 

vol7ron

New Member
Messages
434
Reaction score
0
Points
0
example i gave should work, i'm having some issues though in testing it on x10 because this can't go in the .htaccess and must go in the httpd.conf
 
Last edited:

vol7ron

New Member
Messages
434
Reaction score
0
Points
0
yeah you'll have to talk to an admin about the httpd.conf, usually this is restricted on public hosts.

unfortunately, the only other way is to actually do each one in .htaccess, i think.
 
Top