问题
so yesterday I was having a problem because I wasn't able to implement a 301 redirect to my page hosted on the GitHub pages.
Today I found Netlify which should be able to do 301 redirects. However something is not working, the docs say I need to add the redirect in a _redirect file, but nothings working. Any ideas what I am doing wrong?
Here is the Test page: https://peaceful-swanson-2960b1.netlify.com/
(It should redirect to news when you click on blog)
Here is the GitHub Repo:
https://github.com/vnllab/testy
回答1:
2 things:
you mention the
_redirect
file. It should be_redirects
.I had an issue with a redirect. It took me a while to figure out that if I put a catch-all rule first, the other rules would never be reached (well at least that's what I think was happening, my other rule was ignored...).
This:
/* /index.html 200
http://mysite.netlify.com/* https://mysite.netlify.com/:splat 301!
didn't work, but this:
http://mysite.netlify.com/* https://mysite.netlify.com/:splat 301!
/* /index.html 200
works fine...
来源:https://stackoverflow.com/questions/50201224/netlify-redirect-not-working