SvelteKit: Disable internal link routing for certain <a> links served from the same host

Viewed 1839

I have a link in a Svelte component. The destination of this link is handled by a reserve proxy server, thus the link destination is not part of a Svelte application, even though it shares the same URL path with the Svelte application.

If I click the link Svelte tries to resolve the link with its internal router. How can I force the link in Svelte to be loaded by the web browser and skipped by the internal router?

My link code is:

<!-- /docs/ is served from the reverse proxy by the web server and not part of Svelte -->
<a href="https://tradingstrategy.ai/docs/index.html">Documentation</a>
1 Answers

You can tell SvelteKit to skip handling a link and use normal browser navigation with the rel="external" attribute.

This attribute is documented here: https://kit.svelte.dev/docs#anchor-options-rel-external

<a rel="external" href="https://tradingstrategy.ai/docs/index.html">Documentation</a>
Related