Permalink change and Regex

#93434
  • Resolved Freemason
    Rank Math pro

    Hi,

    I have to change my permalinks, from domain/category/postname to domain/postname. Can you please help writing the proper Regex code to do this?

    Best regards
    Antonio Jorge

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

    Thank you for getting in touch with us.

    You can try the following regex:

    
    Source URL: ^/%category%/(.+)$
    Type: Regex
    Destination URL: https://yoursite.com/$1
    

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi Michael,

    Thanks for your answer. However, after I entered the regex and saved it, ^/%category%/(.+)$ turns into ^/tegory%/(.+)$. Everytime I tryed, (%ca) is removed from code and the resulting regex doesnt work.

    Can you please solve this?

    Regards
    A Jorge

    Hello,

    Please try without the % sign and this in the source:
    /category/(.*)$

    Here is a screencast showing that it works:
    https://i.rankmath.com/xSo2QS

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi Uzair,

    Did you checked your screencast? It seems to end up with a PAGE NOT FOUND screen.

    Regards
    A Jorge

    Alberto
    Rank Math business

    Hello,

    I am sorry for this late reply. Did you already solve it? If not, we could 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.
    Sensitive Data Section

    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.

    Hi,

    I decided not to use RankMath redirections and start using Redirection plugin.

    Regards
    A Jorge

    Alberto
    Rank Math business

    Hello,

    It is fine. If later you want to move back to our redirections module, just let us know and we will help you with that.

    Do you have any other questions?

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

The ticket ‘Permalink change and Regex’ is closed to new replies.