Redirecting deployed sites HTTPS to another HTTPS

I am having two sites with custom external domains hosted on Netlify.
I need to achieve redirecting them so when typing it will redirect to I am not sure what are my possibilities to achieve it ? I found redirecting only for alias names.

Hi @Petra Welcome to the Netlify community!

You can create domain-level redirect rules as per instructions in the docs

Let us know if you run into any troubles.

Thank you for the answer. I already tried that in my public folder in _redirect

Current _redirect file looks like this:
/* /index.html 200

So what I did was to delete the line and replace with:* 301!

Did not work and page was also broken. I am trying to solve it for some time now and it is very important for me to get it running ASAP. Is there anything additional I need to do or am I missing something ?

Make sure the file is called _redirects, NOT _redirect.

This will redirect all pages on your site to index.html on your site, not to another site. If you still have this rule, remove it.

You would place the rule below at the top of your _redirects file.

I followed the steps, it does not work. when I am typing it should go to, but it does not at all.

Can you post the contents of your _redirects file.

This is the content of _redirects* 301!

I believe your bare domains (e.g. are aliases and configured to automatically redirect to your www (e.g. which are your primary domains. (You can check this under the Site settings tab of Netlify admin.)

Therefore, you would need to add* 301!

to your _redirects too.

1 Like

Okay perfect. And both domains needs to be hosted by Netlify? Or is it possible to have hosted on other server ?

You could have elsewhere if you wish. It depends on the functionality you wish to have on your URLs. If your site is indexed by search engines, have redirect to is ideal. You may not have this ability if you move your old domain elsewhere.