How to use Redirection with regex?
-
I’m migrating my Movable Type blog to WordPress, with a different URL structure.
What I’d ideally like is to set up 301 permanent redirect instructions for each of my posts (which are in the format /weblog/2005/12/bbc_blog_platfo.php, ie. 15 characters of title, whereas my new posts are in the WP form /2005/12/15/bbc-pilots-news-mashup-project/). But I have 360 posts and this looks like it would be a nightmare.
So (1) could anyone advise on a mass redirection strategy that points old post URLs to the new?
But (2), in lieu of that, please could anyone help on how to perform wildcard redirects that would at least take someone from, say, /weblog/2005/12/bbc_blog_platfo.php to the corresponding new monthly archive at /2005/12/.
I have the Urban Giraffe Redirection plugin installed. This claims to have “full regex support”. You basically give an “old” URL and a “new URL”. Documentation says:-
>> Both URLs can contain regular expressions (provided the regex option is checked, PHP style preg_replace). For example, if you change where your images are stored from /wp-images to /images you can add one redirection to cover it:
/wp-images/(.*)
/images/$1So, if it is not possible to produce my easily strategy with this, how can I use regex in the old and new URLs to do something a bit less specific? I don’t have any idea how to form these patterns.
Thanks
- The topic ‘How to use Redirection with regex?’ is closed to new replies.