Render's Routing Rules not obeyed on Docusaurus Sites?

Ultimately trying to map multiple URLs to the same Docusaurus page like so.

Here’s a stackblitz link to my build.
The build is currently hosted on Render at https://docs.scious.io and the page in question can be visited by click navigating to Scious Search > Latest. Going directly to https://docs.scious.io/scious-search/latest is currently failing due to the redirect rule we have. My question is, why?

Our only routing rule points /scious-search/* to /scious-search/latest. Redirects in Render are only supposed to kick in if no content is found at the original path.

With that, I would expect a visit to:
https://docs.scious.io/scious-search/this_doesnt_exist
to redirect to:
https://docs.scious.io/scious-search/latest
which the browser does but causes the page to display:

This page isn’t working
site.com redirected you too many times.

ERR_TOO_MANY_REDIRECTS

Of course, I’d expect a visit to https://docs.scious.io/scious-search/latest to not redirect since there is content there but that doesn’t appear to be happening and also throws an error. Can this be a Render specific issue?

Hi,

I suspect this is because you’re trying to redirect to a path of the wildcard and not to a specific static file or folder (trailing / )

You could work around this either by:

  • adding the trailing slash to the destination

  • or with another rule before the wildcard, rewriting specifically to the html file:

Alan

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.