Netlify Website Redirect to another custom website

Hi,

My Gatsby site that I host on netlify see the link: https://cuteanimalplanet.netlify.app/
I want to redirect it to another site anyone can help me with how to do that.
I already see all the doc but I am confused about it how it works.

Thanks in advance

@shagors333 Welcome to the Netlify community. What is the other site? What exactly are you trying to accomplish with this? The docs are pretty clear, and there are endless examples of redirects in this forum, including the use of meta refresh tags.

@gregraven thanks for your reply,
I would like to redirect my https://cuteanimalplanet.netlify.app/ post to my https://www.cuteanimalplanet.com/ this site both content are same,
Main site build with WordPress and netlify site build with Gatsby.

Thanks

@shagors333 This is really easy.

I check the doc but seems it’s not working see the screenshot Screenshot by Lightshot
Is there anything I missed ,
Please check my netlify site https://cuteanimalplanet.netlify.app/

Thanks

@shagors333 Did you re-deploy your site after adding these redirects? Is the redirect file actually showing up in your deploy?

Hi @shagors333,

If you check your deploy summary, it shows that no redirect rules were processed:

(Note: That’s a screenshot of your latest deploy, not a placeholder one, at the time of writing another deploy is currently building)

This indicates that the redirects rules have not been parsed. The _redirects file that you’ve added (in the screenshot), is in the root directory which is not where it should be. It goes in the publish directory, which is case of Gatsby is probably public. To copy the _redirects file to your publish directory during build time, you can leave the file in the static folder and Gatsby will handle the rest.

Try this and see if it works and let us know if you’ve any additional questions.

@hrishikesh thank you so much it’s working now,
I put the redirect file into the static file & it’s working

Appreciate your help

1 Like

Hi @hrishikesh I have another question,
I redirect my netlify site to my original site when I share post in facebook via URL it’s not showing Netlify site link. Could you please tell my why it’s showing original site site. I need to show netlify site link in facebook post

thanks for your previous help

Hi @shagors,

I don’t think I can comment on why Facebook is behaving the way it is. The answer to that question lies with Facebook, not Netlify. As far as I can see, a 301 redirect is successfully working for the domain.

Also, in my testing, I could see the redirect (not 301 for some reason):