6 ms·
The server has nothing to do, pe se, with pushState. That just manipulates the client. If on reload/next visit, you don't want the link to break (which seems li
by marcusf 14y ago
The server has nothing to do, pe se, with pushState. That just manipulates the client. If on reload/next visit, you don't want the link to break (which seems like a reasonable requirement), just set up a route in whatever web server you're running that maps to the url schema you're generating in the client.
- WiseWeasel 14y agoAny thoughts on avoiding generic 404s in case of typo or removed content, in the hope of returning something more useful? Can we use context info from the URL given to personalize the 404 response, or maybe route to a different resource instead for certain contexts? This all seems so simple with client-side hash routing. [Also, would that mean that I would need to maintain a list of every single possible route in the whole site?]
- dmbass 14y agoYou can do whatever you want. You have the URL and can return any arbitrary bytes. The way you look at the hash in JS on the client would be the same way you look at the URL on the server.