I have a number of sites hosted on Netlify and am in the process of migrating some, which were hosted on other domains, under subfolders. For this I’m using the request proxying feature (200 response).
For this I’m using the following pattern, on the “main” site, as described in the docs
/folder/* https://subsite.netlify.app/folder/:splat 200
With this setup, navigating to https://www.example.com/folder/ will correctly proxy and display the content from the target server. Unfortunately, so will navigating to https://www.example.com/folder (no trailing slash) – without redirecting. This caused problems with CSS resources/etc. although this was fixable using absolute paths.
(as an aside I’m not even sure why /folder would redirect when the rule specifies /folder/*)
However, this issue also affects all sub-pages, e.g. https://www.example.com/folder/two will not redirect to https://www.example.com/folder/two/ – regardless of the pretty URL settings on the sub site.
What’s even more weird is if I load up the subsite directly, the trailing slashes are handled correctly. For some reason this behaviour is not being passed through the proxying.
This has implications for duplicate content etc. so I would like to fix it. Any tips?