Title: Regex redirection
Last modified: October 21, 2021

---

# Regex redirection

 *  Resolved [nitinsinghal](https://wordpress.org/support/users/nitinsinghal/)
 * (@nitinsinghal)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/regex-redirection-4/)
 * Hi
 * I am trying to get this done, but not working for me.
 * SU: [https://example.com/category1/](https://example.com/category1/) should be
   the same
    TU: [https://example.com/category1/](https://example.com/category1/)
 * SU: [https://example.com/category1/categor2/](https://example.com/category1/categor2/)
   should also be the same
    TU: [https://example.com/category1/categor2/](https://example.com/category1/categor2/)
 * But with the parameters:
    SU: [https://example.com/category1/categor2/param1/param2/param3/](https://example.com/category1/categor2/param1/param2/param3/)
   should go to TU: [https://example.com/category3/param1/param2/param3/](https://example.com/category3/param1/param2/param3/)
 * The first 2 examples are working, because I have category 1 & category 2 pages.
   But how do I make the 3rd work?
 * Please help.
 * Regards

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

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/regex-redirection-4/#post-14993288)
 * I don’t really understand the question. You’ve given 2 set of URLs that are identical,
   and a third set that is different. What is SU and TU? Why is the third not working?
 *  Thread Starter [nitinsinghal](https://wordpress.org/support/users/nitinsinghal/)
 * (@nitinsinghal)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/regex-redirection-4/#post-14994996)
 * Sorry for my explanation.
 * SU and TU are Source URLs & Target URLs.
 * Actually, I want the redirection for the 3rd set of URLs.
 * I do not want any redirection for the 1st & 2nd set but only want for the 3rd
   set. Please tell me what values should be added to the plugin to get this working?
 * Currently, I am adding this, but not working:
 * ^/categor1/categor2/(.*)
    [https://example.com/category3/$1](https://example.com/category3/$1)
 * Regards
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/regex-redirection-4/#post-14998641)
 * You need to modify the regular expression so that it only matches the URL you
   want. You can use [https://regex101.com/](https://regex101.com/) to test your
   expression.
 * `(.*)` will match 0 or more characters
    `(.+)` will match 1 or more characters

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

The topic ‘Regex 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [John Godley](https://wordpress.org/support/users/johnny5/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/regex-redirection-4/#post-14998641)
 * Status: resolved