Link to home
Start Free TrialLog in
Avatar of rivkamak
rivkamakFlag for United States of America

asked on

htacess with uppercase letters

I am trying to set up a redirect on the second link with the FormDonate page.
but the redirect only works when the page is lowercase.
what did i do wrong?
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^mobile\/formdonate\.html$ "http\:\/\/www\.example.com\/donate\.php" [R=301,L]
   
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^mobile\/FormDonate\.html$ "http\:\/\/www\.example\.org\/donate\.php" [R=301,L]
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

don't use mixed case just use lowercase if you want predictability.
Avatar of rivkamak

ASKER

my old site had the file name like this "FormDonate.html"
I need to redirect it, but I can't get it to work? why not?
because mixed case is normally not supported. is apache also running on a linux server? if not it definitely is not supported.
is there a way i can force the pages to be in lowercase , and then the next rule will be the lowercase version?
Windows doesn't care about case in filenames, Linux requires the exact case in filenames.  You can add 'CheckSpelling on' in your .htaccess file to get Apache to ignore case.  http://httpd.apache.org/docs/2.2/mod/mod_speling.html
ASKER CERTIFIED SOLUTION
Avatar of Insoftservice inso
Insoftservice inso
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just try these one  
RewriteRule ^mobile\/formdonate\.html$ "http\:\/\/www\.example.com\/donate\.php" [QSA,L,NC]
OR

RewriteEngine on
CheckSpelling on

dont forget to change

AllowOverride none

to

AllowOverride All


Use of the [NC] flag causes the RewriteRule to be matched in a case-insensitive manner.