• Resolved nooscare

    (@nooscare)


    I have permalink structure /web/%postname%-%post_id%.html and want to change /%postname%/%post_id%/ How i can make redirection in target and destination? thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @nooscare,

    Assuming your post ID is always 4 digits, and assuming you want to pass any queries along to the target URL, you can try this:

    Source URL: /web/(.*)-(\d{4})\.html(.*)
    Target URL: /$1/$2/$3

    Another option, to save resources if your site has many pages and/or many visitors, would be to avoid the slash between post name and post ID:

    Source URL: /web/(.*)\.html(.*)
    Target URL: /$1/$2

    Always test in a testing website before using in your production site. Let us know if this worked for you.

    • This reply was modified 7 years, 9 months ago by CB.
    Thread Starter nooscare

    (@nooscare)

    @cbrandt: Im not using the option 1 because my post id not always 4 digit, I try to using option 2, it almost works but give me /%postname%-%post_id%/, not /%postname%/%post_id%/

    Hope you can help, thanks 🙂

    In option 1, try using {n,m} instead of {4}, where n is the minimum number of digits, and m the maximum. So if the the number of digits varies between 3 and 6, you would use {3,6}.

    • This reply was modified 7 years, 9 months ago by CB.
    Thread Starter nooscare

    (@nooscare)

    @cbrandt Ok thankyou, I believe this could help me.

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

The topic ‘Permalink Redirection’ is closed to new replies.