Redirection Plugin: Redirect all URLs with a regular expression

I understand little about regular expressions, but I need to figure one out to use with the Redirection plugin which supports redirects with regular expressions. http://urbangiraffe.com/plugins/redirection/

What I need to do is redirect all urls in /oldsite/ to the domain root. That means any page in /oldsite/ like /oldsite/this-is-my-page.html, /oldsite/this-is-my-page-too.html, etc., needs to go to root via a regular expression.

Read More

I can’t get a 301 redirect rule to work in .htaccess for some reason; there may be a restriction at the host, so I need to use this plugin.

It needs to be a regular expression in the format that the plugin understands. Some examples are in the docs for the plugin at that link above. The first field for a new redirection in the plugin takes the regular expression; the second field is the target URL.

This doesn’t work:

Source: /oldsite/*
Target: http://mydomain.com

Nor does this:

Source: ^oldsite/(.*)
Target: http://mydomain.com

Related posts

Leave a Reply

2 comments