Post pagination returns 404s after Regex redirect

#903945
  • Resolved efnweb
    Rank Math free

    Hello,

    This is a follow-up to ticket number 834956. We’ve discovered that post pagination isn’t working after setting a REGEX redirect for our categories from “category/cat-name” to “blog/cat-name.” This works fine, but only in conjunction with setting our Category Base to “blog” in Permalinks.

    However, adding that value in Permalinks in conjunction with the redirect breaks our blog’s pagination. Oddly only the pagination on the main page is broken. Pagination in categories works.If we remove the redirect, all is fine, but then we revert to “category/cat-name,” which is what the redirect is supposed to solve.

    This is our REGEX redirect:

    Source URLs: category/(.*)
    Destination URL: our-site.com/blog/$1

    Scratching our heads on this one. Hoping for some advice.

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

    We apologize for the issue you are facing with post pagination after setting up your REGEX redirect. It sounds like a complex situation where the interaction between the permalink settings and the redirect is causing the pagination to break.

    From your description, it seems that the REGEX redirect is conflicting with the permalink structure when you set the Category Base to "blog." This can sometimes happen if the redirects are not properly configured to account for pagination URLs.

    To troubleshoot this issue, we recommend checking the following:

    1. Review Your Redirects: Ensure that there are no other conflicting redirects that might be affecting pagination. You can use the Redirection Debugger to help diagnose any issues.
    2. Adjust Your REGEX: You might need to modify your REGEX redirect to ensure it does not interfere with pagination URLs. For example, you could try excluding pagination parameters in your source URL.
    3. Test Without Category Base: Temporarily remove the Category Base setting and see if pagination works without it. This can help isolate whether the issue is specifically related to the base setting or the redirect itself.

    If you continue to experience issues, please reply to this ticket, and a human agent from the Rank Math Support team will take over and provide further assistance. Thank you for your patience as we work to resolve this issue!

    efnweb
    Rank Math free

    Hello,

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

    Thank you.

    Hello,

    Thank you for contacting us and sorry for any inconvenience that this issue might have caused.

    In this case, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    efnweb
    Rank Math free

    Hello,

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

    Thank you.

    Hello,

    Unfortunately, the current setup won’t work and the limitation is not our plugin. If you disable our plugin you’ll notice that the blog pagination won’t work and that is because the blog archive is also the archive for the categories with the current permalink structure.

    So, the easiest way to fix this is by changing the permalink of the posts page to something other than the category base so that both types of pages can be loaded on the website at the same time.

    For example, on the staging website we changed the slug of the blog page to blog-rm and everything is working as expected.

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

    efnweb
    Rank Math free

    Great, thank you. I had not considered the blog page ULR slug. Understanding this, we’re reviewing our options. Much appreciate the assistance.

    Hello,

    Glad that we could address your concern.

    If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

You must be logged in to reply to this ticket.