• Resolved odre

    (@odre)


    Is it possible to pass edited source url parameters to dest url?
    I’m looking for something like this:
    source url param: ‘test-page’
    dest url param: ‘test%20page’

    can I get this result by editing plugin? how?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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?

    Plugin Author John Godley

    (@johnny5)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘edit source url parameters’ is closed to new replies.