cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect page to new domain without language codes

Redirect page to new domain without language codes

With my old magento website I used one domain name and language codes for the different languages. Now I created new website and I'm using different domain names for the languages so the language codes have no sense now. The problem is that I don't know how to redirect the old pages in .htaccess .

 

Old pages:

http://domain1.com  (base url - language 1)

http://domain1.com/lang1

http://domain1.com/lang2

http://domain1.com/lang3

 

New pages

https://domain2.com  (language 1)

https://domain3.com  (language 2)

https://domain4.com  (language 3)

 

I know how to redirect the base url but then the language code is generated to the new URL.

 

So what I need is to redirect all the old pages to the new ones.

 

This is my current htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain1\.com [NC]
RewriteRule ^(.*)$ https://domain2/$1 [R=301,QSA,L]