Title: Redirect with querystring
Last modified: August 30, 2016

---

# Redirect with querystring

 *  Resolved [dooza](https://wordpress.org/support/users/dooza/)
 * (@dooza)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/redirect-with-querystring/)
 * How can I setup a redirect where it keeps the querystring? At the moment if there
   is a querystring it doesn’t redirect.
 * [https://wordpress.org/plugins/redirection/](https://wordpress.org/plugins/redirection/)

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

 *  [Tor N. Johnson](https://wordpress.org/support/users/kasigi/)
 * (@kasigi)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/redirect-with-querystring/#post-6283391)
 * If a redirect needs to be query string agnostic using the plugin the solution
   that I’ve found that works is this:
 * 1) Create two redirect
    2) The first redirect is the one w/o query string: /cow//
   horse/ 3) The second redirect handles the presence of query strings: /cow/(\?.*)/
   horse/$1
 *  Thread Starter [dooza](https://wordpress.org/support/users/dooza/)
 * (@dooza)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/redirect-with-querystring/#post-6283394)
 * Ah ha! It didn’t work, then I ticked Regex and its all good, thank you very much!
 *  [mayerwin](https://wordpress.org/support/users/mayerwin/)
 * (@mayerwin)
 * [10 years ago](https://wordpress.org/support/topic/redirect-with-querystring/#post-6283479)
 * Even better, in one redirect:
    /cow/(\?(.*))? to: /horse/$2
 * I love regex.

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

The topic ‘Redirect with querystring’ 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
 * 3 participants
 * Last reply from: [mayerwin](https://wordpress.org/support/users/mayerwin/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/redirect-with-querystring/#post-6283479)
 * Status: resolved