Title: Help with complex redirection
Last modified: May 27, 2021

---

# Help with complex redirection

 *  Resolved [hurry](https://wordpress.org/support/users/extremist87/)
 * (@extremist87)
 * [5 years ago](https://wordpress.org/support/topic/help-with-complex-redirection/)
 * Hi,
 * I was wondering if someone can help me with a bit of a complex redirection, a
   breeze for the wizards.
 * I have a website with 5000 products, we changed the url from /products/ to /examplenew/
   using the following redirect;
 * /product/(.*)$
    /examplenew/$1
 * Now, I was checking the 404 log and found many hits to pages like below from 
   bots; /examplenew/productname/PRODUCTDESCRIPTION
 * So I want to build a redirection rule so that it drops trailing PRODUCTDESCRIPTION
   from every product without making a redirection for each product. Not sure if
   something like the below will work?
 * /product/(.*)1$/^
    /examplenew/$1/

Viewing 1 replies (of 1 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [5 years ago](https://wordpress.org/support/topic/help-with-complex-redirection/#post-14491335)
 * `/product/(.*)1$/^` does not match `/examplenew/productname/PRODUCTDESCRIPTION`.
   You would need something like `/examplenew/productname/(.*)`
 * [https://regex101.com/](https://regex101.com/) can help you create regular expressions
    -  This reply was modified 5 years ago by [John Godley](https://wordpress.org/support/users/johnny5/).

Viewing 1 replies (of 1 total)

The topic ‘Help with complex 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [John Godley](https://wordpress.org/support/users/johnny5/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/help-with-complex-redirection/#post-14491335)
 * Status: resolved