Redirect by regex doesn’t work even though regex match
-
We have an issue where we need to redirect people coming to a page with certain components in the url.
We have written a regex looking like this:
^.*?action=mepr_unauthorized.*?register.*?vip-12-manader.*?$which matches the url we need to redirect from
https://test.example.com/vip-medlemskap/?action=mepr_unauthorized&redirect_to=%2Fregister%2Fvip-12-manader%2FYou can see it matches here:
https://regex101.com/r/XayDxL/1But that doesn’t happen.
Can this be because we were redirected to that url from another url by another plugin (Memberpress)?
But if we go directly to the url:
https://test.example.com/vip-medlemskap/?action=mepr_unauthorized&redirect_to=%2Fregister%2Fvip-12-manader%2F
still it there is no redirection.We have also try to redirect by entering
/vip-medlemskap/?action=mepr_unauthorized&redirect_to=%2Fregister%2Fvip-12-manader%2F
as source but that doesn’t work as it doesn’t seem to handle the encoded slashes.
If we go to
/vip-medlemskap/?action=mepr_unauthorized&redirect_to=/register/vip-12-manader/
we are redirected correctly in this case.The page I need help with: [log in to see the link]
- The topic ‘Redirect by regex doesn’t work even though regex match’ is closed to new replies.