MT to WordPress redirects.

I used the following script to create a mod_rewrite file for my new WordPress install. After running the script, the redirects look like this:

Redirect Permanent /ease/archives/001694.html http://www.poorbuthappy.com/ease/archives/2002/11/23/562/i-renamed-xfmlmanager-to-taxomita

Note the /562/ part. That’s different from the usual WordPress URL’s.

The reason I had to write this script is that the existing scripts assume every item has a title. I have written a lot of my MT entries without title, so I can’t use the http://www.poorbuthappy.com/ease/archives/2002/11/23/i-renamed-xfmlmanager-to-taxomita style, because it assumes no two entries on the same day have the same title. Empty titles wouldn’t really work. It’s not a huge problem, but I tried to solve it anyway, by setting up a URL structure that incorporates the entry ID: (in the WordPress admin, go to Options > Permalinks and use the following code)

/archives/%year%/%monthnum%/%day%/%post_id%/%postname%

This way every entry has a unique URL, even when it doesn’t have a title.

The script below isn’t particularly well developed, so you’ll need to know PHP to adjust it for your purposes. Enjoy.

View the script at http://www.poorbuthappy.com/ease/files/redirect.txt

0 thoughts on “MT to WordPress redirects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s