**UPDATE**: The two listed below are early versions of a consolidated version that I just got working that I think y'all will find works even better:
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/([^/]+)(/?|/trackback|/trackback/)$ http://www.yourdomain.com/$1/$2/$4.phpOld ones:
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/(.+)$ http://www.yourdomain.com/$1/$2/$4.php
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/(.+)/$ http://www. yourdomain.com/$1/$2/$4.php
One of the biggest problems that one faces when converting from WordPress to Movable Type is the loss of links. That's why Byrne Reese's CleanSweep plugin is such a good one to have installed. It generates mod_rewrite rules which allow you to map dead URLs to live ones.
The two rules that I posted above work like a charm for me on my blog, so I thought I would share them. What they do is take a URL like http://www.codemonkeyramblings.com/2008/06/25/test/ and over it over to a live link like http://www.codemonkeyramblings.com/2008/06/test.php.
These rules won't catch all of your bad requests because the WordPress base names (what comes after the date in the URL) are too long. However, they should catch a pretty healthy minority, making it so that if you have them in place before CleanSweep is installed, hopefully CleanSweep will never have to catch many of your dead links in the first place.
Related Entries:
- How to detect requests to old Movable Type-created pages
- Another MT theme project
- Mashing it up with Google Reader
- My latest Movable Type style project
- Connecting to Google Reader from Perl
- Simulating separate trackback and comment URLs with Movable Type
- My new Movable Type style effort: Pixeled
- Image Importer
- Random thoughts
- Creating a better toolbar on your blog


One trick I use for rewriting URLs the opposite way (MT to WP conversions) is to have MT generate a custom template that gives the to-the-second timestamps of all the posts, along with their URLs. This can be in CSV format or as a PHP array, or whatever. Then, iterating through, you can use the to-the-second timestamp to look up the corresponding post in WordPress, and generate the new WordPress URL. You then can do MT to WP URL mapping with 301 redirection in a PHP script. Then you just write one mod_rewrite rule to silently point all the old URLs to the redirection script, which does a 301 redirect to the new URLs. I see no reason this couldn't work in reverse (WP to MT). The to-the-second timestamp is key, because that is one bit of information that is virtually guaranteed to be the same in both publishing platforms, so no matter how crazy your old structure was or your new structure is, you'll be able to forward properly.
Thanks, I look into this when I get a chance! (I can't right now because I'm in the process of moving... :( )