Error 404 for SPA (Single Page Application) #27676
-
Hi, Im making a project that is a SPA, and i want host on github instead of Netlify. But github still not support redirect all to index.html. How i can do it with this new deploy method? Today im using the 404.html file, but it shows http status 404, what is bad :( Can we have something similar to 200.html and http status 200 or something that redirect all to 404.html? Repository: Workflow: Http Status Error: Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Until we support custom headers (and redirections), I think you will need to live with the For now, you could mask the 404 status code by just doing an extra client side redirection from your We don't have an ETA at the moment for when we will have proper support for custom headers and redirection. This is on our radar though. |
Beta Was this translation helpful? Give feedback.
-
@yoannchaudet Why is support for custom headers (and redirections) required if a Is it because you want to build a comprehensive solution rather than another "ad-hoc" band-aid solution? In terms of masking the status code, google does not seem to appreciate it. |
Beta Was this translation helpful? Give feedback.
Until we support custom headers (and redirections), I think you will need to live with the
404.html
trick (e.g. as mentioned here).For now, you could mask the 404 status code by just doing an extra client side redirection from your
404.html
to yourindex.html
(router).We don't have an ETA at the moment for when we will have proper support for custom headers and redirection. This is on our radar though.