• Resolved ventio

    (@ventio)


    Hello, I’m using the Redirection plugin to manage redirects on my website, and I’ve encountered an issue with dynamically passing the original URL in a parameter. Here are the details:

    My redirect settings:

    • Source URL:
      ^/offers/(.*)
    • Target URL:
      /page-no-longer-exists/?ref=/offers/$1
    • HTTP Code:
      301 - Moved Permanently

    Expected behavior:
    I would like a user visiting, for example, the URL /offers/dog-leash to be redirected to:
    /page-no-longer-exists/?ref=/offers/dog-leash

    Current issue:
    Instead of the dynamic value in the ref parameter, after redirection, I see the URL as:
    /page-no-longer-exists/?ref=/offers/

    It seems $1 is not being correctly interpreted as the captured value from the Source URL.

    My question:

    1. Is my Target URL configuration correct?
    2. How can I pass the dynamic portion of the URL (e.g., dog-leash) to the ref parameter in the Target URL? Does this require a different syntax?

    This feature is critical for me, as the ref parameter is later used in a form (CF7) on the destination page.

    Thank you for your help, and I look forward to your guidance.

Viewing 1 replies (of 1 total)
  • Plugin Author John Godley

    (@johnny5)

    Redirection uses PHP and you can find information on the internet about the exact particulars of PHP regular expressions. If something is not working as you expect then you should look at other things that might be affecting it, such as caches and other redirects.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.