How do I redirect a parameter with an underscore in tuckey url rewrite?
-
10-10-2022 - |
Question
I need to redirect old URLs in the form:
/123?var_artikel=666666 to the new URL: /en-GB/product-666666.html.
I tried this rule:
<rule match-type="regex">
<condition type="parameter" name="var_artikel" operator="equal">^([0-9]+)$</condition>
<from>^/123?</from>
<to type="permanent-redirect" last="true">/en-GB/product-%{parameter:var_artikel}.html</to>
</rule>
However the browser tries to redirect to /en-GB/product-%%7Bparameter:var%5C_artikel%7D.html
If I remove the underscore in {parameter:var_artikel} it works. So the underscore is the reason it doesn't work, but of course I need it. Is there a way to escape this underscore? Escaping with \ didn't work..
Edit: Found it, seems to be a bug in Tuckey 4.0.3+
Anyone got a workaround?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow