Is there a way to escape the SPA routing?
See original GitHub issueI have mutliple associated applications running on a parent domain, that will sometimes need to link to each other.
Let’s say the thing lives at example.com. The Svelte app using svelte-router
is on /projects
, where it handles its content through nested routes – /projects/my-example-project
for instance.
When I now create a Navigate
or anchor element linking to /otherapp
or example.com/otherapp
, the SPA router can’t find a configured route and shows a 404 page – instead of requesting the page from the server. While this is in itself expected behaviour, apart from setting target="_blank"
I don’t see a way to reliably handle this scenario.
I know there’s a way to display a custom 404 page – is there a way to handle requests that would result in a 404 before routing happens and send failed root-relative URLs or URLs for the same base domain back up to the server? Anything else I’ve missed?
Thanks in advance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Sorry for the late reply, I only just got around to testing it – and it works beautifully, just as I expected.
Thank you for this magnificent tool and your lightning-fast reaction to my problem, appreciate the great work!
@AndreasMaros Thank you for your comment!