Home
Support Forums

Migrating to new domain - www.xyz.com/* is redirecting but primary domain xyz.com is not

Hello all,

Apologies if I misuse any technical terminology - self taught and trying to manage this domain change.

I’ve had a domain purchased externally but hosted on netlify for over a year now. The website is https://amtsimplified.com

I now want to migrate everything over to a new domain https://equitysimplified.com

Both domains are purchased from the same external site. Both are added as domains on netlify.

In my site setup on Netlify, I have added the new equitysimplified.com as a custom domain, and set it as my primary domain. In addition, on the _redirect file in my hugo config (I use hugo to package/build the site) I have included the line below per this support question.

https://amtsimplified.com/* https://equitysimplified.com/:splat 301!

Open Issues:

  1. I don’t think the _redirect file ever did anything. Ever since adding my custom domain and setting it as my primary domain, https://www.amtsimplified.com/* redirects to equitysimplified just fine.

  2. https://amtsimplified.com/* does not, however, redirect to equitysimplified either. Is there something I’m missing?

  3. Lastly, and this is completely separate, I believe I’ve set everything up so it should minimally impact SEO (via 301 redirects?). Could someone confirm that doing this shouldn’t affect it?

Hi @amtsimplified

On the latest deploy log is there a message saying the redirect rules in the _redirects file were processed? e.g.

Hi @coelmay

Thanks for helping here. Yes there were 3 redirect rules processed without error (as I have 3 on my site)

/iso-tax-planner/ /amt-calculator/
/* /404.html 404
https://amtsimplified.com/* https://equitysimplified.com/:splat 301!

Thanks for sharing the file contents.

As per Rule processing order rules a processed/implemented top-down so the domain redirect is never triggered because the redirect above captures everything.

Change the order to

https://amtsimplified.com/* https://equitysimplified.com/:splat 301!
/iso-tax-planner/ /amt-calculator/
/* /404.html 404

Always have /* rules last.

3 Likes

@coelmay WOW I had no idea the rule processing order was even a thing.

THANK YOU!! Consider this resolved. Just tested and it worked

2 Likes

@coelmay sorry to bug you (or anyone else) again, but do you know if the 301 redirects is more complicated than what’s listed here?

My pages have dropped out of the google search rankings all of a sudden today. Do I need to add in more redirects (such as the below)?

amtsimplified.com/* equitysimplified.com/:splat 301!
www.amtsimplified.com/* www.equitysimplified.com/:splat 301!
https://www.amtsimplified.com/* https://www.equitysimplified.com/:splat 301!

or am I just overthinking things?

If the old domains are indexed, it might help to have an explicit redirect for the www subdomain

https://www.amtsimplified.com/* https://www.equitysimplified.com/:splat 301!

The two below are (in effect) the same thing as the one above and that previously used

amtsimplified.com/* equitysimplified.com/:splat 301!
www.amtsimplified.com/* www.equitysimplified.com/:splat 301!

You might also find adding canonical URL helps too e.g.

<link rel="canonical" href="https://example.com/path/to/page">

See <link> and Link types on MDN.

The following guide from Google may also provide useful information

1 Like

Appreciate it, I will take a look! Adding this line in should do no harm, at least right?

https://www.amtsimplified.com/* https://www.equitysimplified.com/:splat 301!

You would only need to add the www subdomain if that is what appears in Google search results I believe. In both Google and DuckDuckGo I see amtsimplified.com and equitysimplified.com. No www in sight.

thanks for your help @coelmay - I truly do appreciate it!

1 Like