 Joined: Oct 2007 Posts: 79
 
United States
|
Aug 02, 2008, 10:52:55 AM | #2 |
Using RewriteCond/RewriteRule, I'm trying to redirect all requests (except /index.html) aiming to my root directory to the default /fr directory.
It does not seem to work...
Here is my code:
RewriteEngine on RewriteCond %(REQUEST_URI) !/index\.html RewriteRule ^/(.*)$ /fr/$1 [R=301,L]
What's wrong with it?
You don't need the forward slash in the RewriteRule and you should set a RewriteBase. It should look like this
RewriteEngine on
RewriteBase / RewriteCond %(REQUEST_URI) ^index\.html RewriteRule ^/(.*)$ /fr/$1 [R=301,L]
|
|