Peter Van Dijck’s Guide to Ease

7/22/2004

MT to Wordpress redirects.

Filed under: General — Peter @ 1:50 pm

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

2 Comments »

  1. [...] ations Post — David @ 2:46 pm

    Peter Van Dijck has posted code to use for forwarding MT entries to WP entries when your MT post URLs do not inc [...]

    Pingback by High Context » MT to Wordpress redirects without post titles — 7/22/2004 @ 6:49 pm

  2. Hello, Nice blog posting about MT to Wordpress redirects.. I would have to agree with you on this one. I am going to look more into url redirection. This Saturday I have time.

    Comment by Url Redirection — 9/15/2007 @ 4:35 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress