Regex in redirection not working

#899448
  • Resolved Mina
    Rank Math free

    Hello
    I added redirection in rankmath from (.*) to $1 but not working and all pages of my website except the home page are unavailable.
    pleas help me.

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

    We apologize for the issue you are facing with the regex redirection in Rank Math. It seems that the regex pattern you used might be causing an infinite loop or matching too many URLs, which can lead to your pages becoming unavailable.

    To resolve this, please check the following:

    1. Review Your Redirects: Ensure that there are no conflicting redirects that might be causing the issue. If you have a redirect that points to itself, it can create an infinite loop.
    2. Use the Redirection Debugger: Rank Math has a redirection debugger that can help diagnose potential issues with your redirects. This tool can provide insights into what might be going wrong.
    3. Modify Your Regex: If you intended to redirect specific pages, ensure your regex pattern is correctly defined to match only those pages. For example, if you want to redirect all pages under a specific path, your regex should be more specific than just (.*).

    If you’re still having trouble after checking these points, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further. Thank you for raising this concern!

    Mina
    Rank Math free

    Hello
    I checked all these things but my problem was not solved.

    Hello,

    The redirection you added is not correct. Could you please confirm what are you trying to redirect?

    The regex you created makes a redirect loop since all of your pages will only redirect to their own.

    We have disabled the redirect you created to avoid the redirect loop issues on your site.

    Looking forward to helping you.

    Hello,

    Please share some exact source and destination URLs so that we can assist you in creating the regex redirection for your website.

    Looking forward to helping you.

    Thank you.

    Mina
    Rank Math free

    Hello
    Like this :

    I already had a post with this url:
    https://ponel.ir/website

    I changed the url to this:

    https://ponel.ir/why-reason-website

    And now I want to change the url again to the original address:

    https://ponel.ir/website

    But didnt work.

    Mina
    Rank Math free

    https://i.ibb.co/NsDF66N/1.jpg

    https://i.ibb.co/yX6ngH1/2.jpg

    Hello,

    Since you have changed back the permalinks to /website, you can simply remove the Source URL /website to avoid a redirection loop. Your focus here is to redirect only /why-reason-website to /website.

    As for the regex redirection rule you’ve shared, it is not the correct way of using it as it will only cause another redirection loop. Regex is meant to target specific URL patterns and using regex redirection to redirect the entirety of your URLs will cause the website basically unusable.

    Don’t hesitate to get in touch with us if you have any other questions.

    Mina
    Rank Math free

    Hello
    If I delete the /website , the redirects from my previous domains will not be transferred with the same url.

    Hello,

    If you don’t remove /website from your source URL, it will create a redirection loop.

    However, please note that Rank Math doesn’t handle server/domain-level redirection. In this case, can you please confirm which redirection you’re referring to from your previous redirection?

    Looking forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Regex in redirection not working’ is closed to new replies.