Hello,
I am using Netlify DNS for domain-a.com
and domain-b.com
, both of which are the same Netlify app. My goal is to redirect www.domain-a.com
to domain-a.com
, and www.domain-b.com
to domain-b.com
.
Currently I have domain-a.com
as my “primary” domain, and www.domain-a.com
was automatically configured to redirect to domain-a.com
(it says “Redirects automatically to primary domain” on my setting page).
I added both domain-b.com
and www.domain-b.com
as “Domain aliases” for domain-a.com
. I would like the same behavior as domain-a.com
, specifically www.domain-b.com
should redirect to domain-b.com
.
I found this page in the docs which says to create a _redirects
file to the root of my site, presumably with this content:
http://www.domain-b.com/* https://domain-b.com/:splat 301!
https://www.domain-b.com/* https://domain-b.com/:splat 301!
Is it possible to achieve my desired redirect by modifying my Netlify DNS settings, or must I add the _redirects
file? I didn’t have to add the _redirects
file to handle my primary domain, so can I do the same for my alias?
Thanks!
David