I did follow [Support Guide] Can I deploy multiple repositories in a single site? to deploy a blog in a subfolder eg. https://www.test.com/blog
The issue that I have with this method is that the “pretty url” feature does not help me to enforce a trailing slash for all blog urls.
I have added
[[redirects]]
from = "/blog/*"
to = "https://my-blog.netlify.app/blog/:splat"
status = 200
But when I visit https://www.test.com/blog
I get 200. But I would like to get 301 to https://www.test.com/blog/
(with trailing slash)
I did try
[[redirects]]
from = "/blog/*/"
to = "https://my-blog.netlify.app/blog/:splat"
status = 200
[[redirects]]
from = "/blog/*"
to = "/blog/:splat/"
status = 301
But this does not has an effect because Netlify will match paths to rules regardless of whether or not they contain a trailing slash:
What this means for your redirect rules is that Netlify will match paths to rules regardless of whether or not they contain a trailing slash.
These rules are effectively the same:
either rule alone would trigger on both paths
/blog/title-with-a-typo /blog/typo-free-title
/blog/title-with-a-typo/ /blog/typo-free-titleThis rule will cause an infinite redirect
because the paths are effectively the same
/blog/remove-my-slashes/ /blog/remove-my-slashes 301!
I am unable to find a solution to this problem.