Redirect one owned domain to another owned domain

Hello all!

I have 1 domain that I want to redirect to another domain with Netlify. I thought I could add a _redirects file on the root and it would automatically redirect to the other domain.

Like so,

https://domain1.edu https://domain2.edu 301!

But its not working.

Any help would be greatly appreciated!

1 Like

That would only direct requests to literally https://domain1.edu to https://domain2.edu . That should work as far as it goes if:

  1. we are configured to serve domain1 on the site you deploy _redirects on.
  2. there is a valid SSL certificate for domain1 on the site you deploy _redirects on.
  3. you never expect visitors to use a URL like https://domain1.edu/somepage since that redirect ONLY handles the bare URL.

Would be useful to get a reference to your real site to examine the setup, but at least, you’ll want to use something like this instead:

https://domain1.edu/* https://domain2.edu/:splat 301!

…and you’ll want that to be the TOP redirect in your file since it needs to come before anything else.