-
I found a gross hack today to host a Single Page App on GitHub pages with no fallback URLs. You can specify a 404.html file which is served for “not-found” pages, with a http 404 code.
-
Then in that html file you can run JavaScript to redirect to hash based routing. const url = new URL(location.href) url.hash = url.pathname url.pathname = '/' location.href = url.toString()
-
It’s not ideal, but for a site which we’re archiving it means we can turn off all servers and host for free on GitHub pages. Then if anyone has links to the old site they still work.
-
This is now live if you were interested schedule.pdc2022.org/session/892ddf2a-376a-4503-868c-2e85b2352349