Jump to content

A domain which redirect straight to a language version


Recommended Posts

Hey, i look after that but couldn't find it...
I have a global domain in .com, and a local domain .fr which i would like to redirect straight to my prestashop French version . In the setting of my hoster "OVH" I try to put " /www/lang-fr"
But of course lang-fr it's not a real directory for the hoster so it didn't work.

Anyone have any suggestion to do that?

Link to comment
Share on other sites

I don't think the problem is geo related.

You can try this rewrite in the .htaccess file

RewriteCond %{HTTP_HOST} ^yourdomain.fr
RewriteRule ^(.*)$ http://www.yourdomain.com/lang-fr/$1 [R=permanent,L] 

RewriteCond %{HTTP_HOST} ^www.yourdomain.fr$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/lang-fr/$1 [R=301,L] 



You also need to redirect your .fr domain to the same directory as your .com domain.

Or you can create a new directory for the .fr site and place this code in a new .htaccess file there (don't forget adding "RewriteEngine on")

Link to comment
Share on other sites

I don't think the problem is geo related.

You can try this rewrite in the .htaccess file

RewriteCond %{HTTP_HOST} ^yourdomain.fr
RewriteRule ^(.*)$ http://www.yourdomain.com/lang-fr/$1 [R=permanent,L] 

RewriteCond %{HTTP_HOST} ^www.yourdomain.fr$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/lang-fr/$1 [R=301,L] 



You also need to redirect your .fr domain to the same directory as your .com domain.

Or you can create a new directory for the .fr site and place this code in a new .htaccess file there (don't forget adding "RewriteEngine on")



Ok thanks you very much buddy!
Just to know, what it's the difference between [R=permanent,L] and [R=301,L] ?

thanks again :)
Link to comment
Share on other sites

×
×
  • Create New...