Title: Plugin Redirection &#8211; wildcard expression
Last modified: August 20, 2016

---

# Plugin Redirection – wildcard expression

 *  [Mr E](https://wordpress.org/support/users/ebiladdress/)
 * (@ebiladdress)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-redirection-wildcard-expression/)
 * My goal is to use the plugin Redirection to forward a whole section of the website
   automatically, I would like it to be so that I can wildcard a url so that any
   child items are redirected:
 * [http://www.domain.com/folder/](http://www.domain.com/folder/) is set to go to
   [http://www.domain.com](http://www.domain.com)
 * and all other child items such as domain.com/folder/1/ and domain.com/folder/
   2 automatically follow the rule with no further specification.
 * [http://wordpress.org/extend/plugins/redirection/](http://wordpress.org/extend/plugins/redirection/)

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

 *  [Joseph](https://wordpress.org/support/users/jbojang/)
 * (@jbojang)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-redirection-wildcard-expression/#post-3207601)
 * I’m looking for the same solution.
 *  [Todd Edelman](https://wordpress.org/support/users/toddedelman/)
 * (@toddedelman)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-redirection-wildcard-expression/#post-3207676)
 * Me as well.
 * Tried using the format /folder/(.*) but it did not work.
 *  [berchman](https://wordpress.org/support/users/berchman/)
 * (@berchman)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-redirection-wildcard-expression/#post-3207679)
 * I tried like Todd to get a wildcard to work and had no luck.
 * /slug/(.*) => /newslug/(.*)
 * No luck.
 * Any suggestions are welcome.
    Thanks, Bert
 *  [sroot](https://wordpress.org/support/users/sroot/)
 * (@sroot)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-redirection-wildcard-expression/#post-3207680)
 * Strange, I read that .* matches any character any number of times. Maybe the /
   is an exception in this plugin.
 * Anyway, I’d avoid the problem and create a set of redirects, eg:
 * source:/folder/
    target:/
 * source/folder/(.*)/
    target:/
 * source:/folder/(.*)/(.*)/
    target:/
 * [@berchman](https://wordpress.org/support/users/berchman/)
    try Source: /slug/(.*)
   Target: /newslug/$1 and don’t forget to tick the regex checkbox.
 * For each ‘match’, the regex makes the match available as a variable, $1.
    So 
   in the first example source:/folder/(.*)/(.*)/ target:/newfolder/$1/$2/
 * I had to do a similar thing for my redirects, [my notes here](http://www.steveroot.co.uk/2012/11/wordpress-redirects/)
 * I hope that helps,
    Steve
 *  [berchman](https://wordpress.org/support/users/berchman/)
 * (@berchman)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-redirection-wildcard-expression/#post-3207683)
 * Steve,
    Thanks for sharing the link to your site with examples. Really helps.
 * This is what I have now and seems to work.
 * source url:
    /questions/([0-9a-zA-Z_-]*)/(.*)
 * target url:
    /question-posed/$2
 * This seems to get things working and out of the redirect loop.
 * Best regards,
    Bert
 *  [jani74](https://wordpress.org/support/users/jani74/)
 * (@jani74)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-redirection-wildcard-expression/#post-3207694)
 * “Maybe the / is an exception in this plugin.”
 * yep, it doesn’t like it.

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

The topic ‘Plugin Redirection – wildcard expression’ 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/)

 * 6 replies
 * 6 participants
 * Last reply from: [jani74](https://wordpress.org/support/users/jani74/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-redirection-wildcard-expression/#post-3207694)
 * Status: not resolved