Redirect all traffic from one store to another.

Solved

Redirect all traffic from one store to another.

samgwatts
Visitor
2 0 0

Hi Guys.

I really need some help regarding redirecting from one store to another. 

I have two Shopify stores A and B. A has a lot of traffic that goes to that domain, B is a fairly new site and we want all traffic from A to be diverted over to B. Its a rebrand with a completely new site. 

 

I know I can upload a redirect CSV to store A with all the redirects BUT I can't redirect the homepage of A to B, Shopify won't allow a redirect of the homepage. 

 

I don't want to make store A have a different primary domain, I simply want all traffic from store A flow to store B and maintain all the SEO work that has been done on A. Do I need to do something with my domain provider swell as Shopify? 

 

Thanks for your help.

Sam 

Accepted Solution (1)

theycallmemakka
Shopify Partner
1661 396 416

This is an accepted solution.

Hi @samgwatts 

From an SEO perspective, it's not recommended to redirect the site to a different domain. This will hamper your SEO in the long run. However, if the main requirement, i.e., to redirect users from the home page to a different domain, exists, we can add the following codes to the theme.liquid file.

<script>
if(window.location.pathname == "/"){
    window.location = "##NEW STORE URL HERE##"
}
</script>

Note: Replace "##NEW STORE URL HERE##" with the URL of the new site where you would like to redirect.

 

Steps to add JS:

Step 1: Go to Online Store > Themes > Active theme > Edit

makkaomakka_0-1696009705404.png

 

 

Step 2: Search for "theme.liquid"

makkaomakka_1-1696009705832.png

 

 

Step 3: Add the CSS above "</head>"

makkaomakka_2-1696009705422.png

 

 

If you require further help to optimize your store, please don't hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

 

Best Regards,
Mangit

Support Me: Buy me a Coffee


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

View solution in original post

Replies 2 (2)

theycallmemakka
Shopify Partner
1661 396 416

This is an accepted solution.

Hi @samgwatts 

From an SEO perspective, it's not recommended to redirect the site to a different domain. This will hamper your SEO in the long run. However, if the main requirement, i.e., to redirect users from the home page to a different domain, exists, we can add the following codes to the theme.liquid file.

<script>
if(window.location.pathname == "/"){
    window.location = "##NEW STORE URL HERE##"
}
</script>

Note: Replace "##NEW STORE URL HERE##" with the URL of the new site where you would like to redirect.

 

Steps to add JS:

Step 1: Go to Online Store > Themes > Active theme > Edit

makkaomakka_0-1696009705404.png

 

 

Step 2: Search for "theme.liquid"

makkaomakka_1-1696009705832.png

 

 

Step 3: Add the CSS above "</head>"

makkaomakka_2-1696009705422.png

 

 

If you require further help to optimize your store, please don't hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

 

Best Regards,
Mangit

Support Me: Buy me a Coffee


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

samgwatts
Visitor
2 0 0

That's awsome. Totally did the trick!

Thank you.