cancel
Showing results for 
Search instead for 
Did you mean: 

301 Redirect multi store views to main store view

301 Redirect multi store views to main store view

I just deleted multi store views for my magento 2 store.

the deleted page resulted in 404 error: Page not found..

I want to 301 redirect these dead pages of dead store views to main store views.

For example:

 

Homeage:

Main store views: http://www.imdomain.com

FR store views:  http://www.imdomain.com/fr/

DE  store views:  http://www.imdomain.com/de/

 

I want to 301 redirect http://www.imdomain.com/de/http://www.imdomain.com/fr/ to http://www.imdomain.com

 

Category Page:

Main store views: http://www.imdomain.com/categoryname1/http://www.imdomain.com/categoryname2/

FR store views:  http://www.imdomain.com/fr/categoryname1/http://www.imdomain.com/fr/categoryname2/

DE  store views:  http://www.imdomain.com/de/categoryname1/http://www.imdomain.com/fr/categoryname2/

 

I want to 301 redirect http://www.imdomain.com/fr/categoryname1/  & http://www.imdomain.com/de/categoryname1/  to http://www.imdomain.com/categoryname1/ .

Besides, I want to I want to 301 redirect http://www.imdomain.com/fr/categoryname2/  & http://www.imdomain.com/de/categoryname2/  to http://www.imdomain.com/categoryname2/ 

 

Product Page:

same as category page Smiley Happy

 

Thanks so much for your help! My magento version is v2.2.0

 

1 REPLY 1

Re: 301 Redirect multi store views to main store view

Hi @benlauseo,

 

I guess you will need the list of URLs that won't work anymore (because you've deleted the stores) and then you will need to create the redirects.

You can use .htacess if you are using Apache or you can add the redirects to your vhost configuration.

Another options could be to use the Magento URL rewirte option but I guess you'll get better performance adding the URLs to your vhost configuration.