MemePlace / Frontend

Frontend Repo
3 stars 0 forks source link

Fixes Github SPA Redirects #84

Closed Step7750 closed 6 years ago

Step7750 commented 6 years ago

Github Pages doesn't really understand how SPA works and will redirect any route outside of index.html to 404.html.

This is a hack that allows us to preserve the URL, redirect to index.html and load the correct route in JavaScript.

Example:

In the app, it uses JavaScript to change the URL to meme.place/c/bitconnect

If the user reloads the page, GitHub tries to find a file at meme.place/c/bitconnect and can't, so it loads up 404.html. This PR will overwrite the 404 file and preserve the URL while redirecting to index so it can figure out what to load.