Title: New redirection
Last modified: May 26, 2022

---

# New redirection

 *  Resolved [makistout](https://wordpress.org/support/users/makistout/)
 * (@makistout)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/)
 * Hello
 * I need to make the following redirection
 * /category/category_name/page_number to /category/category_name/page/page_number
 * I have created this regex rule
 * /category/(.*)$/(.*)$ to /category/$1/page/$2
 * but it doesn’t seem to work.
 * Please advice

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

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680493)
 * Why do you have `$` in the middle of the expression?
 *  Thread Starter [makistout](https://wordpress.org/support/users/makistout/)
 * (@makistout)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680515)
 * Otherwise we get this (although we use ^ at the beginning of the expression)
 * [https://domain/category/category_name/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/1](https://domain/category/category_name/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/1)
    -  This reply was modified 4 years ago by [makistout](https://wordpress.org/support/users/makistout/).
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680521)
 * The `$` indicates the end of the URL, so it cannot be used in the middle. You
   probably want to use `(.*?)` instead
 *  Thread Starter [makistout](https://wordpress.org/support/users/makistout/)
 * (@makistout)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680562)
 * I use this /category/(.*?)/(.*?)$ to /category/$1/page/$2
 * or this ^/category/(.*?)/(.*?)$ to /category/$1/page/$2
 * but still have the problem
 * /category/category_name/page/page/page/page/page/page/page/page/page/page/page/
   page/page/page/page/page/page/page/page/1
 * as a result
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680574)
 * Yes, your expression is matching `page`. You will also need to modify it so that
   it doesn’t match `page`.
 * You can use [https://regex101.com](https://regex101.com) to build and test your
   expression
 * [https://regex101.com/r/wxIUax/1](https://regex101.com/r/wxIUax/1)
 *  Thread Starter [makistout](https://wordpress.org/support/users/makistout/)
 * (@makistout)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680805)
 * John this is probably a 5 minutes work for you. Could I contribute somehow to
   get a solution?
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680861)
 * Sorry, I’m not trying to be difficult, but I don’t provide that kind of service.
   I get many, many, requests for these, and if each one took 5 minutes (which they
   often don’t) then I wouldn’t have much time left to do anything else.
 * The support page has references and examples that may be useful. Regular expressions
   are not specific to Redirection and there is a lot of information out there.
 * [https://redirection.me/support/redirect-regular-expressions/](https://redirection.me/support/redirect-regular-expressions/)
 *  Thread Starter [makistout](https://wordpress.org/support/users/makistout/)
 * (@makistout)
 * [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680869)
 * Thanks John for your help 🙂

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

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

 * 8 replies
 * 2 participants
 * Last reply from: [makistout](https://wordpress.org/support/users/makistout/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/new-redirection/#post-15680869)
 * Status: resolved