However, this leads to an infinite loop because /category/foo/ redirects to /blog/category/foo/ which redirects to /blog/blog/categories/foo/ and so on.
Is there any way to specify to match only the full path after the hostname? An equivalent in regex would be ^/category/....
Sure, https://docs.rs/globset/0.4.15/globset/#example-configuring-a-glob-matcher is a good default. Honestly, I overlooked it because the path separator character on Unix-like systems will never be matched by default as far as I can tell. Anyways, PR is welcome.
","upvoteCount":0,"url":"https://github.com/orgs/static-web-server/discussions/498#discussioncomment-11384458"}}}Infinite redirect loop #498
-
|
I have a website where I switched frameworks behind it which means that most URLs slightly changed. For example:
So I set up a redirect as follows for those categories that still exist: [[advanced.redirects]]
source = "/category/{*}/"
destination = "/blog/category/$1/"
kind = 301However, this leads to an infinite loop because Is there any way to specify to match only the full path after the hostname? An equivalent in regex would be |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
|
Your |
Beta Was this translation helpful? Give feedback.
Sure, https://docs.rs/globset/0.4.15/globset/#example-configuring-a-glob-matcher is a good default. Honestly, I overlooked it because the path separator character on Unix-like systems will never be matched by default as far as I can tell. Anyways, PR is welcome.