It would be nice, if one could enforce trailing slashes at least for specific urls. In my case I would like
to forward /admin to /admin/, but doing that via the routes.json file results in a redirection loop.
I agree that this would be a nice feature. Often this comes up with default pages in subfolders that use relative URLs in links and access resources (like images) with relative URLs. Example:
If there's a file at /foo/bar/index.html, it can be accessed at all of the following locations:
/foo/foo//foo/index.htmlIf there are any relative URLs in the page, those URLs will not work when accessing the page using /foo. To deal with this, most web servers will redirect /foo to /foo/.
Here's an example here:
/foo/index.html has a link <a href="bar.html">relative link to bar.html</a>:
https://delightful-island-0d63ac010.azurestaticapps.net/ which causes the relative link to fail@stephtr Is this the same scenario you're running into, or do you have other reasons to need this redirect?
That's more or less exactly my use case.
Could you do two redirects?
redirect /foo => /temporary/
redirect /temporary/ => /foo/
Did anyone ever getting a resolution on this? Encountering the same issue.
Most helpful comment
I agree that this would be a nice feature. Often this comes up with default pages in subfolders that use relative URLs in links and access resources (like images) with relative URLs. Example:
If there's a file at
/foo/bar/index.html, it can be accessed at all of the following locations:/foo/foo//foo/index.htmlIf there are any relative URLs in the page, those URLs will not work when accessing the page using
/foo. To deal with this, most web servers will redirect/footo/foo/.Here's an example here:
/foo/index.htmlhas a link<a href="bar.html">relative link to bar.html</a>:https://delightful-island-0d63ac010.azurestaticapps.net/which causes the relative link to fail@stephtr Is this the same scenario you're running into, or do you have other reasons to need this redirect?