0
votes

I am using WooCommerce on my webshop. I bought a new domain where I made a 301 redirect from my old page to the new page.

https://old-domain.dk/ redirect to https://new-domain.dk/

I forgot one thing.. I have to redirect the WooCommerce shop aswell.

https://old-domain.dk/shop has to redirect to https://new-domain.dk/shop

But I have around 1000 products in my shop. So I do not want to just redirect to the main page of my new site. Fx:

https://old-domain.dk/shop/furnitures should redirect to https://new-domain.dk/shop/furnitures.

Is there anyway that I can redirect all my products in the shop at once to the new site, or do I have to do that one by one?

Update I can see my question has been marked as the question already has been answered in other question. I am well aware of how to make a 402 redirect. But on a wordpress website you have to domains on your shop. https://old-domain.dk and https://old-domain.dk/shop/. The normal domain is redirecting, but the /shop domain I do not know how to redirect in .Htaccess.

I tried to set the redirect in .Htaccess - public_html- But this is not working.

Best Regards.

1
how did you make your redirection? - Kaddath

1 Answers

0
votes

I guess this .htaccess config will do that

RewriteEngine on
RewriteCond %{HTTP_HOST} ^old-domain.dk [NC,OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.dk [NC]
RewriteRule ^(.*)$ http://new-domain.dk/$1 [L,R=301,NC]

I think a minimal config like this will also work.

RewriteEngine On
RewriteRule ^(.*)$ http://new-domain.dk/$1 [R=301]

Cheers.