Reputation: 232
After more than one hour of searching, I still can't figure out how to redirect a link from http://site/fr/other
to http://site/other
.
I am using this code:
RewriteEngine On
RewriteRule ^/fr/(.*)$ /$1 [L,R=301,QSA]
Upvotes: 3
Views: 11941
Reputation: 325
To remove '-xyz-' from the url
RewriteRule ^(.*)-xyz-(.*).html$ http://%{SERVER_NAME}/$1-$2.html [NC,R=301,L]
To remove 'xyz' from the url 'http://yoursite.com/xyz/some-url.html'
RewriteRule ^xyz/(.*)\.html$ $1-watches.html [L,R=301]
To remove 'xyz' from the url 'http://yoursite.com/some-dir/xyz/some-url.html'
RewriteRule ^(.*)/xyz/(.*).html$ http://%{SERVER_NAME}/$1/$2.html [NC,R=301,L]
Upvotes: 2
Reputation: 6665
Just remove the first forward slash: RewriteRule ^fr/(.*)$ /$1 [L,R=301,QSA]
.
Try this out at http://htaccess.madewithlove.be/.
Upvotes: 8