I have a specific scenario to work with and need help.

Currently I have set up for 8 years a Magento 1 multi website store with this configurations:

Magento is installed in a subfolder of a domain and its on the shop.olddomain.com

Added 4 website's and in Magento option enabled 'add store code to url's':

  • website 1 - store 1 - store view 1 url: shop.olddomain.com/us/ USA

  • website 2 - store 2 - store view 2 url: shop.olddomain.com/eu/ EUROPE
  • website 3 - store 3 - store view 3 url: shop.olddomain.com/hr/ CROATIA
  • website 4 - store 4 - store view 4 url: shop.olddomain.com/si/ SLOVENIA
Now I want for Europe, Croatia and Slovenia website to move each of them to newly bought domains separately. It needs to become:

  • 2 - newdomain.eu
  • 3 - newdomain.hr
  • 4 - newdomain.si

and for US to stay the same:

  1. olddomain.com/us/

How to achieve that with .htaccess 301 redirects (and in the same time to disable in Magento option 'add store code to url's)

  1. Installed Advanced Store Code url https://www.safemage.com/advanced-url-store-code.html to easy on/off storecode to url's per website one by one while developing solution

  2. added subfolder in Magento root as exactly was store code I turned off for the website (like /eu) and add .htaccess redirectom rules RewriteRule ^(.*)$ https://newdomain.eu/$1 [R=301,L]

  3. in main Magento .htaccess added SetEnvIF environment variable

SetEnvIf Host .newdomain.eu. MAGE_RUN_CODE=eu SetEnvIf Host .newdomain.eu. MAGE_RUN_TYPE=website

  1. turned off Add Store Code to Url's in Magento backend for EU website

  2. repeat for each other website

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.