Issue with Regex Redirects in Rank Math Not Working

#1062514
  • Resolved Darren R
    Rank Math free

    Hi I’m trying to set up a wildcard redirect in Rank Math to redirect all URLs that begin with /faq/ to our new central FAQ page at /faqs/. Example: /faq/can-i-have-a-different-size/ → /faqs/ I’ve added the redirect in Rank Math using a regex pattern like ^/faq/.*$, with match type set to Regex and a 301 redirect. However, it’s not working — none of the /faq/… URLs are being redirected, just go to 404. I tested an exact match redirect in Rank Math and it works perfectly, so the redirection module is active and functioning. I checked with my host Gridpane to see if it was an nginx issue and they suggested contacting RankMath support.

    Thanks

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

    I apologize for the issue you are facing with the regex redirect in Rank Math. It seems like you are on the right track with your regex pattern ^/faq/.*$, but there might be a couple of things to check to ensure it works correctly:

    1. Ensure the Redirect is Active: Double-check that the redirect you created is active in the Rank Math Redirection settings.

    2. Trailing Slashes: Sometimes, trailing slashes can affect redirects. Make sure that your source URL pattern accounts for any variations, such as /faq/ vs /faq.

    3. Nginx Configuration: Since you mentioned using Nginx, ensure that there are no conflicting rules in your Nginx configuration that might be preventing the redirect from working.

    4. Testing the Regex: You can test your regex pattern using tools like regex101.com to ensure it matches the intended URLs correctly.

    5. Debugging: Rank Math has a redirection debugger that can help diagnose potential issues with your redirects. Make sure to utilize this feature to see if there are any errors being reported.

    If you’ve checked all of these and it’s still not working, please reply to this ticket with your site URL so we can assist you further. A human agent from our support team will take over and provide more specific guidance.

    Thank you for raising this concern!

    Sources:
    How to Use Regex Redirects in Rank Math » Rank Math
    How to Set Up Redirections » Rank Math

    Hello,

    We updated the regex on your website, and now it is working properly without any issues. Please check the screenshot in the sensitive data section for reference.

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank you.

    Thanks so much for fixing, so the pattern I was using was incorrect?

    Hello,

    Yes, Rank Math regex redirection doesn’t support a forward slash at the beginning of the source URL. We removed the forward slash and restructured the regex.

    However, we are glad that it helped.

    Can you please confirm if you still need our assistance with anything else or we can close the ticket?

    Looking forward to hearing back from you.

    Thank you.

    Thanks for the explanation, the ticket can be closed!

    Resolved

    Hello,

    We are glad we could address your concern.

    Please feel free to create a new forum topic if you do have another question in the future.

    It will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Issue with Regex Redirects in Rank Math Not Working’ is closed to new replies.