Domain Alias redirect Issue

I seem to be correctly redirecting a domain alias [www.website.net] to [website.com], but going directly to [website.net] does not redirect to it to [website.com]. Instead, it’s loading the .net version of the site (which I do not want — I want it to redirect to .com).

I’ve added an A record to the .net DNS that points to Netlify, and added the [website.net] domain alias to Netlify (with .com set as the primary domain). How come [www.website.net] correctly redirects but [website.net] does not?

1 Like

@JonYablonski Please provide your Netlify site name, domains, and other information when you post. The better the post = the faster we can help!

Yes of course. Netlify site name is https://keen-wiles-7e259f.netlify.app. Primary custom domain is https://jonyablonski.com/. Custom domain alias is: https://jonyablonski.net/. Attached is a screenshot of my DNS settings for jonyablonski.net. Thanks for the help!

Why not set up the .com version on Netlify, and redirect to that, rather than point to the .net version and then try to redirect it?

My understanding of DNS is beginner at best. Are you saying the better approach here is to point .net version to .com via CNAME and remove the A record? I was trying to follow along with these docs.

@JonYablonski I’m a little punchy from being on the road all day, but I think what you want to do is add both your jonyablonski.com and jonyablonski.net custom domains in the Netlify Domains dashboard. If you already have, great.

Then in your keen-wiles Netlify dashboard, add each of these – adding jonyablonski.com first – and setting jonyablonski.com as your primary domain, with www.jonyablonski.com redirecting to jonyablonski.com.

Then add jonyablonski.net (and www.jonyablonski.net, of course) as domain alias via your keen-wiles Netlify dashboard, and redirect them to your primary domain (jonyablonski.com).

These steps should handle all your redirects except for from keen-wiles to jonyablonski.com, which you can do in a _redirects instruction via a Domain Level Redirect, as per the documentation.

All good Greg! I appreciate the help.

I ended up getting everything to work and it matches up with what you’ve instructed, but Netlify dashboard instructed to add an A record for jonyablonski.net, and a CNAME record for www.jonyablonski.net to my domain DNS. I’ve also included in my _redirects file:
https://www.jonyablonski.net/* https://jonyablonski.com/:splat 301!
https://jonyablonski.net/* https://jonyablonski.com/:splat 301!

Perhaps the rules in _redirects are unnecessary?

1 Like

@JonYablonski The A record and CNAME record are needed because for jonyablonski.net you are using Bluehost for your DNS instead of Netlify.

When everything else is set up properly, those DNS entries should be redundant, but I doubt they are hurting anything.