Closed megatank58 closed 2 years ago
There is a caveat though, the responses will have 404 status code which might not be ideal for SEO, another option is to use the 404.html to redirect to index.html which will return the 200 code and behave the same way
This is why we haven't done this. Returning a 404 status code on every page is definitely not desirable - and redirecting it to the anchored version doesn't really solve anything, as at that point you're just relying on the anchored version anyways. There is no functional difference between the two in the first place - having a single hash in the URL is not a big deal, and not worth hacky workarounds like this to avoid, IMO.
That makes sense, I'll close the PR then
This PR makes the router use history mode which changes all URLs from
/#/
to/
, by adding a404.html
which is a copy ofindex.html
which serves the site as it normally would so refreshing the browser does not gives the github 404 page but instead shows the siteThere is a caveat though, the responses will have
404
status code which might not be ideal for SEO, another option is to use the404.html
to redirect toindex.html
which will return the200
code and behave the same wayA preview can be seen at the preview