Title: Permalink Redirection
Last modified: August 30, 2018

---

# Permalink Redirection

 *  Resolved [nooscare](https://wordpress.org/support/users/nooscare/)
 * (@nooscare)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/permalink-redirection-3/)
 * 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)

 *  [CB](https://wordpress.org/support/users/cbrandt/)
 * (@cbrandt)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/permalink-redirection-3/#post-10642131)
 * Hi [@nooscare](https://wordpress.org/support/users/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](https://wordpress.org/support/users/cbrandt/).
 *  Thread Starter [nooscare](https://wordpress.org/support/users/nooscare/)
 * (@nooscare)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/permalink-redirection-3/#post-10642440)
 * [@cbrandt](https://wordpress.org/support/users/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](https://wordpress.org/support/users/cbrandt/)
 * (@cbrandt)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/permalink-redirection-3/#post-10642449)
 * 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](https://wordpress.org/support/users/cbrandt/).
 *  Thread Starter [nooscare](https://wordpress.org/support/users/nooscare/)
 * (@nooscare)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/permalink-redirection-3/#post-10645008)
 * [@cbrandt](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

## Tags

 * [regex redirection](https://wordpress.org/support/topic-tag/regex-redirection/)

 * 4 replies
 * 2 participants
 * Last reply from: [nooscare](https://wordpress.org/support/users/nooscare/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/permalink-redirection-3/#post-10645008)
 * Status: resolved