Passing URL parameters

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hello,

    Thank you for contacting Rank Math today.

    I would suggest that you make use of some regex expressions to check for the URLs that you want to redirect to. I can suggest that you read through this guide to help in coming up with the most appropriate expression.
    I would suggest that you make use of this tool to test the links before using them on the live site.

    I hope this info helps. Thank you.


    Well, I have looked at that, and I have had hose in the old Redirection plugin. As technical as I am, Regex feels really obtuse to me.


    This shows in the tool it matches things like

    But entering that doesn’t seem to actually work. And nothing I can come up with, regardless of regex documentation, seems to pass the parameters along. And I know it’s not your responsibility, but in the references you gave I can also not come up with a matching expression.


    Anyone else have an idea of a regex that works that passes the parameters?

    I’d certainly appreciate an option in settings or per redirect to ask for all URL parameters to be passed through…



    Thank you for contacting Rank Math today and sorry for the delay on this.

    Would you mind sharing some temporary admin access to your site so that I can investigate this issue further? Please enter the data through the sensitive data section.

    Looking forward to helping you. Thank you.


    I have updated the sensitive data as requested. Can you please check further?
    Thank you.

    So there is a redirection called grounding (exact match) and it works if you pass a parameter:
    redirects to
    …and does not generate a 404 error.

    Another redirection, coaching, also exact match:
    just goes to the 404 page and doesn’t redirect.

    Not using regex with either, and it is weird to me that one works and the other does not with the same parameters.

    This site used to use the Redirection plugin, the settings now imported into RankMath.

    Thanks for your help figuring this out!



    Thank you for contacting Rank Math today and sorry for the delay.

    I have made some changes to your coaching redirection and I believe that it should now meet your criteria without using the regex.

    Let me know if this is the kind of functionality that you were after. Thank you.


    This still does not redirect to

    Also, I just get a 404 error still with this one. What I see in the change is that you added another “exact” match, same as the first. If that is what you intended to do, could you explain why two exact matches of the same word is meant to make this work in some way?


    • This reply was modified 2 years, 7 months ago by Rick Wilkes.


    In order to pass URL parameters, you will need to capture a group with the regex pattern, and then reuse it in the destination URL.

    For example, you can use the following Regex pattern in the Source URL field (make sure to select the Regex comparison type in the dropdown):
    And use this for the Destination URL:

    The $1 part will represent the captured group (\?.*) which is a question mark followed by any characters.

    Hope that helps.

    Wow thanks!

    I noticed I also needed to add a second Regex match in order the:


    and the…


    to both match. Is there a single regex that would match /test and /test/ without messing things up? Or should I just plan on entering both?

    • This reply was modified 2 years, 7 months ago by Rick Wilkes.


    Here’s the regex pattern for that:
    This should match all these versions:


    Hope that helps. If you need anything else, don’t hesitate to ask.

    Actually, yours worked great and too great, since it would also match something like:

    By putting a ^ at the start of the regex, it only matches the exact, I think:

    Look right to you? I was getting some infinite loops with things like:

    redirecting to


    unless I added the ^

    Thanks so much for helping get me there!


    Hello Rick,

    Sorry, it took a while but we are glad that it is working now.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

Viewing 13 replies - 1 through 13 (of 13 total)

The ticket ‘Passing URL parameters’ is closed to new replies.