Redirect to custom domain

I have
But my website is also available on
I am using Netlify DNS

How to configure here to redirect to custom domain

hi there,

if you set up your custom domain correctly, it will point to .

Your site will also still be available under the URL if someone types that in, there is no way to remove that, as the system requires it.

It definitely looks like is set up correctly :+1:

Does this answer your question?

Is there a way to redirect to

You can do it in JavaScript if you can get the following code into your page somehow:

if (location.hostname.endsWith('')) {

You can see it in action here:

@perry I haven’t personally tried, but isn’t that something you could do with _redirects since both domains are applied to the site and should be treated the same? 301! or etc.?

Hi, @okradzemirian, I’m chiming in to +1 , @jonsully’s solution above. (I see you have already marked that a the solution as well.)

Thanks for answering, @jonsully! :+1:

1 Like