Reputation: 937
We crated a redesign for our shop and changed the URL structure for the languages.
For german language it was: http://www.domain.com/product/
New it is: http://www.domain.com/de/product/
For french it was: http://fr.domain.com/product/
New it is: http://www.domain.com/fr/product/
How can I achieve that the product pages will be redirectet to the specific language?
Thank you!
Upvotes: 1
Views: 66
Reputation: 785128
You can use these rules just below RewriteEngine On
in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteCond ^product/ http://www.domain.com/de%{REQUEST_URI} [L,NE,NC,R=301]
RewriteCond %{HTTP_HOST} ^fr\.domain\.com$ [NC]
RewriteCond ^product/ http://www.domain.com/fr%{REQUEST_URI} [L,NE,NC,R=301]
Upvotes: 1