Wildcard redirect

#834956
  • Resolved efnweb
    Rank Math free

    Hello,

    Hoping for a little assistance.

    We’re trying to implement a 301 redirect that changes URLs to any post category from “category” to “blog,” like this:

    FROM: our-site.com/category/ANY-CATEGORY-TITLE
    TO: our-site.com/blog/ANY-CATEGORY-TITLE

    Rankmath’s AI tool says that this should work:

    FROM: [category/(.*)]
    TO: blog/$1

    Presumably that is a Regex redirect, though we tried all redirect options, but none work.

    We also tried the following for TO: https://our-site.com/blog/$1, but that still doesn’t work.

    Note that we have defined the “Category Base” value to “blog” in WordPress’ Permalinks settings, which works when accessing a category from a post’s meta details, but we also need to redirect links from search engines that still go to “category/post-title”.

    Thanks ahead,
    FJ

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

    Thank you for reaching out to us for assistance with setting up a wildcard redirect in Rank Math.

    To redirect URLs from "category" to "blog" for any post category, you are correct that you need to use a Regex redirect. The pattern you mentioned should work correctly. Here’s how you can set it up:

    Source URL: [category/(.*)]
    Destination URL: blog/$1

    However, if you have already tried this and it’s not working, please ensure the following:

    1. Make sure the Regex redirect is correctly entered in the Rank Math Redirections settings.
    2. Check that there are no conflicting redirects that might be affecting this specific redirection.
    3. Ensure that the Rank Math plugin is updated to the latest version.

    If after checking these points the redirect still doesn’t work, please reply to this ticket, and a human agent from our support team will assist you further.

    Thank you for your understanding.

    Best regards.

    Sources:
    Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
    How to Redirect Posts After Changing URLs » Rank Math
    WordPress Permalink Structure & Changing Individual URLs » Rank Math
    How to Use Regex Redirects in Rank Math » Rank Math

    efnweb
    Rank Math free

    Hello,

    None of those steps and more worked for us. Can we still get a little help with this? Host is WPEngine.

    Hello,

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

    Kindly use the following redirection rules:

    Source URL: category/(.*)
    Match Type: Regex
    Destination URL: /blog/$1
    Redirection Type: 301 Permanent

    Let us know how this goes. Also, let us know if you have further questions or concerns.

    Thank you.

    efnweb
    Rank Math free

    Thank you very much. Although I thought that was an approach we tried but failed, it definitely now works for us. Possibly one conflict was another redirection we had in place to redirect “/category” to “/blog” (after setting Category Base = blog in the Permalink Settings). Initially that redirect was set as “Exact” but we changed it to “Starts With.” I can’t say for sure that it caused a conflict, but your solution, Ike, definitely works for us. Much appreciation.

    Hello,

    We are glad to know that this issue has been resolved. Thank you for letting us know.

    This ticket will be closed now, but you can always open a new one if you have any other questions or concerns. We are here to help you with anything related to Rank Math.

    We appreciate your patience and cooperation throughout this process.

    Thank you for choosing Rank Math.

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

The ticket ‘Wildcard redirect’ is closed to new replies.