I have a _redirects
file in my netlify directory structure
/
- site
-- _redirects
_redirects
https://example.netlify.com/ https://www.example.com/:splat 301!
https://www.example.com/post/196 https://www.example.com/comic/post-name
Problem:
The first redirection occurs successfully, but the 2nd one returns:
Page Not found
I have followed the documentation in https://www.netlify.com/docs/redirects/ but cannot find a cause of this issue.
I note 2 potential causes mentioned in the documentation:
You can also add redirect rules to your netlify.toml file.
^^ I have not tried this, but since it reads "also" I assume using _redirects
file should be sufficient.
For Jekyll, this requires adding an include parameter to config.yml.)
^^ I am not using Jekyll as far as I know, but my project does contain a config.yml
file.
Solved by adding:
[[redirects]]
from = "https://www.example.me/post/196"
to = "https://www.example.me/comic/post-name"
status = 200
to netlify.toml
source of solution: https://www.netlify.com/docs/redirects/