Table of contents
- A file exists for that path
- Redirect file can't be accessed by Netlify
- Minified redirect file
- Check the deployment logs
So you followed the Netlify docs [↗] on how to set up redirects but they still don't work.
Here are three things you can double-check to fix this:
A file exists for that path
Redirects only work if Netlify can't find a file to serve up for a requested path.
So for example, if the path /jobs
was initially served up by an HTML file jobs.html
you will need to delete that for the redirect to work.
Redirect file can't be accessed by Netlify
You should check to see if the _redirects
file exists in your HTML files.
If you happen to have a build process the _redirects
file might be left out of the generated HTML output.
In this case, Netlify won't be away of any redirect requests.
Minified redirect file
Some build systems include a minification process. This could mess up your redirect file by compressing everything into one line.
At that point, you are left with an invalid _redirects
file and the Netlify platform won't be able to properly parse it and trigger redirects.
Check the deployment logs
One of two things could be the reason your redirects don't work.
Either the redirect file can't be accessed by Netlify or the semantics of your redirect instructions are not interpreted properly.
You can rule out access to the file by checking the deploy tab on your Netlify Dashboard.
Netlify will log out any redirect instructions it finds as part of the deployment log.
Once you rule that out, you can then focus on double-checking your redirect instructions.
Here is another article you might like 😊 PHP check if string contains