Disable Client-Side Routing for Specific Links Pointing to the Same Domain in Discourse

Hello,

I’m running a Discourse instance at https://example.com and a Docusaurus documentation at https://example.com/docs/my-lib. When I link to the documentation from Discourse, the link attempts to route client-side and results in an error saying the page can’t be found. However, if I manually enter the URL or open it in a new tab, it works fine.

Is there a way to prevent certain subpaths from being routed client-side in Discourse? My current workaround is to use an HTML anchor element with target="_blank" to force the link to open in a new tab. I’d prefer to use Markdown for links without having to rely on HTML.

Thanks!

1 Like

That’s why it’s recommended to use discourse on its own hostname, but they’re not very helpful.

It might be possible to create a theme component that would add a route to /docs and have it treat it as en external link. Maybe with window.location.replaceWith('http://example.com/docs/'); or maybe with it doing a 301 redirect

2 Likes