Do you want to redirect URL to a destination with white space?
It needs to be REGEX and instead of %20 for a space equivalent, use [\s]
It works with you redirecting from white space to non-space, but not sure if this will work another way.
Thread Starter
odre
(@odre)
I’m saving last part of url to parameter $1.
let say url is oldpage.com/test-page so $1 is: ‘test-page’
then I’m appending it to the end of destination url.
so I am redirected to: mypage.com/search?var=test-page
what I’m trying to achieve is to replace all “-” in $1 with a space symbol “%20”
expected result: mypage.com/search?var=test%20page
I couldn’t find a way to do it in regex, so maybe it’s possible to do it by editing the plugin?
It’s not possible to perform additional changes to the target. You would need to use the redirection_url_target hook described here: https://github.com/johngodley/redirection and write your own code to manipulate the target URL.