Support » Plugins and Hacks » Redirection plugin and regular expressions
5 years, 5 months ago
Is there anyone good with regular expressions used by the Redirection plugin http://urbangiraffe.com/plugins/redirection/ who can show me what to use in order to redirect all URLs from a folder to the domain root?
I.e., an page in 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.
This doesn’t want to work:
I think your problem could be that you are trying to match “^oldsite/(.*)” rather than “^/oldsite/(.*)”. I don’t bother using ^ in my matches though.
Also, you may find it useful to include the actual old page in the new url as a query string, as you’ve tagged it, something like:
You can then see your redirections in Google analytics etc.
I found a really nice regex cheat sheet the other day at http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/ so it might be worth you printing that out, and experimenting!
Thanks, was able to get it to work with:
The extra RegEx in the target resulted in keeping the old URL in the browser bar for some reason.