yarek
yarek

Reputation: 12044

.htaccess : write rule with langage parameter for SEO

The goa is to rewrite:

www.example.com/fr/something.php ->www.example.com/something.php?lang=fr

I tried with:

RewriteRule ^.*/fr/(.*)$ http://www.example.com/$1?lang=fr[R,L]


RewriteRule \/fr\/(.*)$ http://www.example.com/$1?lang=fr[R,L,QSA]

RewriteRule /fr/(.*)$ http://www.example.com/$1?lang=fr[R,L,QSA]

Not good: Any idea ?

Upvotes: 0

Views: 13

Answers (1)

Croises
Croises

Reputation: 18671

Try with:

RewriteEngine on
RewriteRule ^fr/(.*)$ /$1?lang=fr [QSA,L]

I do not think you want a redirect, but only a rewrite (without changing the url)

Upvotes: 1

Related Questions