1 min read

Tools for future-proofing MT

I've been thinking about future-proof ing URLs in Movable Type lately, and it seems like what is really missing is a migration tool.

Say all your MT archives are setup to use the default system, that relies on ID values, like:

http://example.com/archives/000184.html

And you want to move on to something like:

http://example.com/04/03/12/my_post_title

It'd be nice if there was a simple little perl script that could look at your MT post titles and figure out what your final urls would be, and then pull the post ID to create one giant text file listing where old pages were and what their new names are.

Basically, I want a script that can produce a .htaccess file on the fly. It can't be that hard if this plugin had access to MT IDs and titles. It's just a text file as output, which perl is perfect for. Is there already something out there like this that I've missed?

update: Brad Choate sent this as a possible fix:

<MTEntries lastn="10000">
Redirect 301 /archives/<$MTEntryID pad="1"$>.html /weblog/<$MTEntryDate format="%y/%m/%d"$>/<$MTEntryTitle dirify="1"$>
</MTEntries>

Thanks Brad! I could just make this a new template, then move my archives around and load it up as the .htaccess file. Nice.

Subscribe to the blog

Become a subscriber receive the latest updates in your inbox.