I desperately need help with Regex redirection

#871457
  • Resolved Miguel Annefalk
    Rank Math free

    Hi
    I want to go from %postname% to %category%/%postname% and i just can’t find the right Regex for this. Is there a way to accomplish this?

    Many thanks in advance

    Regards

    Miguel

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

    We apologize for the issue you are facing with regex redirection. To achieve the redirection from %postname% to %category%/%postname%, you can use the following regex:

    Source URL:

    ^(.*)/(.*)$

    Destination URL:

    https://rankmath.com/wp-content/uploads/2022/10/add-regex-redirect-1.jpg

    Make sure to replace `https://rankmath.com/wp-content/uploads/2022/10/add-regex-redirect-1.jpg with your actual domain name. This regex captures the category and post name from the original URL and redirects it to the new structure.

    If you need further assistance or have more questions about using regex redirects in Rank Math, please feel free to reply to this ticket, and a human agent from our support team will assist you further.

    Thank you for raising your concern!

    Sources:
    How to Redirect Posts After Changing URLs » Rank Math
    How to Use Regex Redirects in Rank Math » Rank Math

    Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    Sorry, but this isn’t possible with Rank Math at the moment.

    This is because our plugin’s Redirection module will not be able to determine the category associated with the post to construct such an automated redirection rule.

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

    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 2 replies - 1 through 2 (of 2 total)

The ticket ‘I desperately need help with Regex redirection’ is closed to new replies.