• Resolved freemason

    (@freemason)


    Hi,

    I need tho change my permalinks from domain/category/postname to domain/postname. Unfortunatelly I dont have thecnical knowledge to do it myself. Can anybody help me writing the proper regex code? I would be fantastic if it could be AMP aware.

    Best regards
    A Jorge

    • This topic was modified 3 years, 6 months ago by freemason.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rank Math

    (@rankmath)

    Hello @freemason

    Thank you for your message.

    Firstly, we do not recommend changing the permalink URL structure if your website is already getting some traffic and the pages are indexed. The URL structure does not have any direct impact on the rankings.

    But if you still want to change the structure, you can do that from here:
    /wp-admin/options-permalink.php
    WP Dashboard > Settings > Permalink Settings
    https://i.rankmath.com/wg3pSi

    Hope that helps.

    Thread Starter freemason

    (@freemason)

    HI,

    Thank you for your prompt answer. However, my problem is not on where to change the permalinks. My problem is on the proper Regex expression to turn the current permalink (domain/category/post) into the new permalink (domain/post). I need to find the proper Regex expression to remove the Category from the permalink.

    I tryed teh follwing but it doesn work:

    Source: ^/.*?/(.*)
    Target: /$1/

    Can you help me on this?

    Regards
    A Jorge

    Plugin Author Rank Math

    (@rankmath)

    Hello @freemason

    Please try the following pattern:
    Source: ^[^/]+/([^/]+)/?$
    Destination: $1

    Hope that helps. Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect using Regex’ is closed to new replies.