CB
(@cbrandt)
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.
@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 🙂
CB
(@cbrandt)
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.
@cbrandt Ok thankyou, I believe this could help me.