Redirections Issue

#1049790
  • Resolved Joseph Terrell
    Rank Math pro

    Hi. I am having trouble with my rankmath redirections.

    I want to redirect this URL:

    mywebsite.com/behaviors/page/2/

    To this URL:

    mywebsite.com/category/behaviors/page/2/

    I am using this redirection Source URLs with Regex set: ^/([^/]+)/page/(d+)/?

    I am using this Destination URL: https://www.mywebsite.com/category/$1/page/$2/

    Under testing this never seems to trigger, I have tried it on multiple pages but it does not catch the targets. I have validated the regex with a regex tester and it should match it correctly.

    I have created a simple redirection for a deleted page and that worked correctly.

    Have I configured something wrong here, or do you have any insights you can share with me?

    Thank you.

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

    We apologize for the issue you are facing with your Rank Math redirections. It seems like you have set up your regex and destination URL correctly, but there might be a few things to check to ensure everything works as expected.

    1. Check the Regex Pattern: Your regex pattern ^/([^/]+)/page/(d+)/? is designed to match URLs that start with a slash, followed by any characters until the next slash, then /page/ followed by digits. Make sure that the URL you are testing matches this pattern exactly. For example, it should match /behaviors/page/2/ but not /behaviors/page/2 or any other variations.

    2. Trailing Slashes: Ensure that the trailing slash in your source URL is consistent with how your URLs are structured. If your site does not use trailing slashes, you might want to adjust your regex to account for that.

    3. Redirection Settings: Make sure that the redirection is activated in the Rank Math settings. Sometimes, if the redirect is not activated, it won’t work.

    4. Order of Redirections: If you have multiple redirections set up, ensure that there are no conflicting rules that might prevent this redirect from triggering.

    5. Caching Issues: If you have caching enabled on your website, clear the cache after making changes to your redirection settings to ensure that the new rules are applied.

    6. Debugging: You can use the Redirection Debugger in Rank Math to diagnose potential issues with your redirects. This tool can help identify if the redirect is being triggered or if there are any conflicts.

    If you’ve checked all these points and it still doesn’t work, 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! We’re here to help you resolve it.

    Sources:
    How to Set Up Redirections » Rank Math

    Hello,

    Thank you for contacting Rank Math support. We apologize for any inconvenience this might have caused.

    Please try this regex instead:

    
    Source URL: ^/behaviors/page/(\d+)/?$
    
    Destination URL: https://www.mywebsite.com/category/behaviors/page/$1/
    

    That should match exactly what you’re trying to redirect.

    We hope this helps you fix the issue.

    Please let us know if this works for you or if you need any further assistance. We are always happy to help.

    Thank you

    Thank you, Adetayo.

    But “behaviors” also needs to be a variable as this is a WordPress category.

    Hello,

    At the moment, Rank Math’s redirection module doesn’t support using dynamic WordPress category variables in the way you’re intending. Rank Math only utilizes Regex and while it can help match patterns, it doesn’t have access to WordPress context like categories.

    You’ll need to create separate redirection rules for each category you want to handle.

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

    Hello,

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

    Thank you.

    Hello,

    Please update the source of the regex redirect to the one we have added in the sensitive data section.

    Once done, clear your website’s cache and check again.

    Looking forward to helping 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 6 replies - 1 through 6 (of 6 total)

The ticket ‘Redirections Issue’ is closed to new replies.