Redirect a alias domain to primaru domain doesn't work

Hello,

My need is simple but I did not found the answer and all my tries failed.

I have one netlify site : https://mecanikaswing.netlify.app

I have two domain that I want to redirect to this netlify app, these two domains are register outside of Netlify but for both, I delegate the DNS management to netlify.

The first domain is: mecanikaswing.fr, everything works well. Its my primary domain in netlify DNS
The second one is: audepomswing.fr, configured as alias domain in netlify DNS.

What I want is that when I type : https://audepomswing.fr, the user is redirected to https://mecanikaswing.fr and I want that the URL change!

I’ve tried to setup differents stuff in _redirect file and netifly.toml… but seems nothing works.

My last try in netlify.toml:

[[redirects]]
  from = "http://audepomswing.fr"
  to = "https://mecanikaswing.fr"
  status = 301
  force = true

[[redirects]]
  from = "https://audepomswing.fr"
  to = "https://mecanikaswing.fr"
  status = 301
  force = true

And rules are well processed:

2 redirect rules processed

All redirect rules deployed without errors.

Any idea? Advice?

Hum… it seems finally like this it works.

Not yet for http://www.audepomswing.fr/ but I will figure out.

Any comment still welcome!

Hi @Psychokrameur,

You’ve not added www version of the audepomswing domain to your site. Thus, no redirect.

Simple… it was added in global domain management but not as alias on the website.
Let’s do the redirect and should be done!

thanks

1 Like

Glad this worked! Let us know if you have any additional questions or concerns. Happy building :rocket: