Support Forums

Questions about _redirects rule not working

I seem to have the exact same problem as the original poster. I’ve got a Gatsby app and here’s the content of _redirects, which is saved at the root of my project:

# Redirect default Netlify subdomain
https://jobcast-www.netlify.app/* https://www.jobcast.net/:splat 301!

Going to https://jobcast-www.netlify.app/ doesn’t redirect to the custom domain. I’ve tried this in multiple browsers and multiple operating systems. I’ve also tried it using http tools such as Fiddler and Curl.

Here’s a sample request ID:

X-NF-Request-ID: 4cbb2703-8375-4ac2-8381-a5ae80856205-20084531

@luke, can you please investigate? Thanks in advance!

Hi, @johnny. I split this into a new topic for clarity. I think the issue isn’t the rule itself but that the rule isn’t being found.

This is the active deploy at the time of the request (and thank you for included the x-nf-request-id id):


There I see the following:

No redirect rules processed

This deploy did not include any redirect rules. Learn more about redirects.

Would you please check that the _redirects file is being put into base of the publish directory (the “publish” not the build directory) before the build ends?

Thanks @luke! You solved it for me. I wasn’t sure how to check that _redirects was being put in Netlify’s publish directory, but I ran a local build of my Gatsby app and _redirects wasn’t appearing in the output directory. So I moved the _redirects file from the root of the Gatsby project to the static folder and _redirects appeared where it should. Everything is working well now. Thank you!

1 Like

Hi, @johnny. Thanks for following up to confirm the solution in this instance. Closing the loop helps us know if there advice we give is helpful or not and makes the community site much more useful for people searching.