-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Describe the bug
Just experienced a weird bug with the Twitter Mac app, where a URL with a hash in it (https://craftcms.com/knowledge-base/configuring-load-balanced-environments#mutex-locks) was getting its hash mark encoded to %23:
https://craftcms.com/knowledge-base/configuring-load-balanced-environments%23mutex-locks
I figured it would be easy enough to add a redirect for that in Retour, however Retour ended up decoding the %23 to #, and then didn’t like how the redirect URL looked identical to the URL pattern, saying it would create an infinite redirect loop.
I ended up working around it by setting the Match Type to regex, and the URL pattern to:
/knowledge-base/configuring-load-balanced-environments.+mutex-locks
Ideally Retour would not be decoding the %23 – if that’s even possible? – and also should not be rejecting matching URL patterns/destination URLs if the pattern contains a #, since the hash would never get sent to the server in the first place.
To reproduce
- Go to Retour → Redirects and create a new redirect
- Enter
/foo%23baras the URL pattern - Enter
/foo#baras the destination URL - Press Save
Expected behaviour
The redirect should save, with the URL pattern unmodified, and no warnings about redirect loops.
Versions
- Plugin version: 3.1.69
- Craft version: 3.7.27