How can I redirect a secondary domain to a specific page within my store?

Solved

How can I redirect a secondary domain to a specific page within my store?

sancuscommerce
Shopify Partner
17 1 2

I have 2 domains for my store. The primary one works fine.. it sends the user to the homepage.

 

The second domain, I want to send a user to domain-specific page within my store. When I try to create a URL redirect in the admin, I get a "Path can't be blank" error.

 

Screenshot 2023-11-20 at 6.54.10 PM.png

 

If I change the Redirect from to add a path (ie, http://www.example.com/example.htm) then it allows me to save the redirect. But customers wont go to a path in the url, they will just type the www.example.com in the browser and I need them to be redirected within the site to the example page I have created.

 

Also, is there a way to have the redirect keep the original domain name instead of changing to the primary domain?

Accepted Solution (1)

StephensWorld
Shopify Partner
1398 174 365

This is an accepted solution.

Hey @sancuscommerce 

 

I recently answered a question similar to this in this thread: https://community.shopify.com/c/technical-q-a/redirect-with-dns-settings/td-p/2297744 

 

TLDR: If you purchased the 2nd domain (that you're trying to point to a specific page) via Shopify, then it's not possible to redirect it to a specific page (it'll just point to the homepage). If you purchased the domain via GoDaddy, then you can setup "domain forwarding" (https://ca.godaddy.com/help/forward-my-godaddy-domain-12123) to point it to the page you're wanting it to go to. 

 

Cheers,

Stephen

★ Did my post help? If yes, then please like and accept solution. ★

https://stephens.world
support@stephensworld.ca

View solution in original post

Replies 6 (6)

StephensWorld
Shopify Partner
1398 174 365

This is an accepted solution.

Hey @sancuscommerce 

 

I recently answered a question similar to this in this thread: https://community.shopify.com/c/technical-q-a/redirect-with-dns-settings/td-p/2297744 

 

TLDR: If you purchased the 2nd domain (that you're trying to point to a specific page) via Shopify, then it's not possible to redirect it to a specific page (it'll just point to the homepage). If you purchased the domain via GoDaddy, then you can setup "domain forwarding" (https://ca.godaddy.com/help/forward-my-godaddy-domain-12123) to point it to the page you're wanting it to go to. 

 

Cheers,

Stephen

★ Did my post help? If yes, then please like and accept solution. ★

https://stephens.world
support@stephensworld.ca

sancuscommerce
Shopify Partner
17 1 2

my dns is with route 53 on aws. It looks like I can configure an s3 bucket to do the redirect and use route 53 to point to the bucket. thanks!

Alice_O_Connell
Tourist
9 0 6

Hi Stephen,

To clarify, if I want my second domain to point / forward to a specific page on my website, should I delete the domain from my Shopify list?
I have a primary domain which points to my homepage and a second domain which is set to forward to a specific page in my shopify site, yet it is only working on mobile and not on desktop...on desktop it redirects to my primary domain.
Many thanks in advance!

Dirk
Shopify Staff
2428 259 542

Hey, @Alice_O_Connell 

To redirect a secondary domain to a specific page within your Shopify store, you can follow these steps: 

For the secondary domain, where you want to send users to a specific page within your store, you may encounter an error message like "Path can't be blank" when attempting to create a URL redirect in the Admin. 

To resolve this issue, you can try using a third-party Shopify app like Easy Redirects by Aperitive to set up the desired redirection. This app should allow you to specify the exact path or page within your store that the secondary domain should point to.

 

If there is anything else I can help you with, please let me know.

Dirk | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

ZenoPageBuilder
Shopify Partner
1052 203 225

Hello @sancuscommerce 👋

You can not redirect the homepage to another page. Even if you set up a 2nd domain, it will still be treated as a domain to your store, so not possible to redirect it to a subpage.

Zeno Page Builder - Build responsive & SEO-optimized Landing pages, Blog posts, Product pages and more...
Learn more at zenobuilder.com

SM-Shpfy
Visitor
1 0 0

There is a solution to this problem!

You can add a little custom javascript to your site to make this work:

 

Go to Themes -> Select 3 dot menu and select "Edit Code"

 

Open theme.liquid

 

Scroll down till you see </head>

 

Add the following code substituting your URLs:

 

   <!-- Below coded added to create a redirect when landing at napathefuncart.com
     to send the user to the specific landing page -->
  <script>
    function redirecDomainToLandingPage() {
      window.location.replace("https://www.yourdomain1.com/pages/thePageYouWant");
    }
    if(window.location.href == "https://yourdomain2.com/" || window.location.href == "https://www.yourdomain2.com/") {
      redirecDomainToLandingPage();
    }
  </script>
  <!-- END CODE ADDED -->

 

What this code is doing is when your main page loads it looks at the url and if it matches say your second domain, it will redirect the browser automatically to the domain and page of your choosing.

 

Hope this helps anyone else that comes along later.