Took my relocation/redirection problem over to #joiito, where I tossed around some possible solutions (meta refresh tags, .htaccess files, sql queries, etc). Then I saw server guru Mark Pilgrim lurking in the channel, and asked his advice.
Ever the gentleman, Mark not only advised me to take the .htaccess route, he even whipped up a quick MT template for me to generate the .htaccess file with redirects.
The one he created would be run on the new server, and so assumes that the post IDs are the same (they are, since I did a mySQL export/import rather than using MT). Then the file would be placed on the old server. The archive template looks like this:
<MTEntries lastn=”999999”>
Redirect permanent /archives/<$MTEntryID$>.html <$MTEntryLink$>
</MTEntries>
If I hadn’t preserved the post IDs through mySQL, however, I think an alternative would be to create the .htaccess on the old server, using this template:
<MTEntries lastn=”999999”>
Redirect permanent /archives/<$MTEntryID$>.html http://www.mamamusings.net/archives/<$MTArchiveDate format=�%Y/%m/%d�$>/<$MTEntryTitle dirify=�1�$>.php”
</MTEntries>
Either way, I’d end up with a lengthy .htaccess file that I could then place in the archives directory of the old server (after creating all the files on the new server, natch).
I think that ends up being the most elegant solution. Thanks, Mark! (Thanks also for publishing your blog templates; those were also extremely helpful.)
Perhaps more women would be in technology if more women were listened to...
My htaccess file is:
RewriteEngine On
RewriteCond %{REQUEST_URI} \.php$
RewriteRule ^(.*)\.php$ http://weblog.burningbird.net/fires/$1.html [R=301,L]
to redirect PHP requests from /archives to HTM requests in /fires. And since it uses mod-rewrite, performance is quite good. Better than with redirect -- and less space. One tiny file.
If you want, you can vet this solution past Sam Ruby.
My apologies for the implication implicit in the last comment -- but I was a bit hurt to see this post.
Regardless, you should consider this approach, at least think about it. If you want to discuss it at the IRC, I think you'll find that most people, perhaps even Mark, will agree that you'll probably get better performance. If you don't have mod_rewrite installed, I can rewrite this using an alternative approach.
Or use your approach -- it's your weblog.
I'm not 100% sure I have access to mod_rewrite on the it.rit.edu server.
The problem with mod_rewrite, though, is that I'm going from numbered entries on the old server to "dirified" entry names on the new server. So there won't be a standard rewrite rule I can use.
For example, I'll want to redirect from http://www.it.rit.edu/~ell/archives/000504.html to http://www.mamamusings.net/archives/2003/07/23/fear_of_flying.php.
So far as I can tell, I wouldn't be able to do that with mod_rewrite. But the .htaccess approach allows me to generate a list of relationships between entry number and new name.
Since there are only about 330 entries, and I don't tend to get super-high traffic on my archives, it seemed like a reasonable tradeoff.
(Please do note, also, that I _explicitly_ thanked you by name and linked directly to your comment in my previous rainy day post. There are lots of people who have been generous with their expertise as I work through this, and I'm genuinely grateful to all of you.)
As I said Liz, I'm sorry. You're right -- that was churlish of me.
You're going with the new format on the new server -- I had missed that in your note (missed the previous posting, too, originally). You're right in that this complicates things.
Sorry.
S'okay. I'm a bit grumpy tonight, myself. Single-parenting doesn't agree with me, and I've spent too many hours with the laptop instead of real grownup people today.
wow. looks complicated. geeez. what if i decide to move my Radio weblog hosting to a self-hosted MT solution on the digitaltavern.com server? I have no idea how permalinks could be saved, let alone just getting it to work.... and Joi wants me to move to Moveable Type...
mod_rewrite lets you do all sorts of fun redirections, and the redirects are pretty easy to customize within Movable Type templates. Even if you're switching servers and file naming schemes at the same time, it won't take much code. Here's my current rewrite template:
http://blogs.bwerp.net/templates/archive_rewrite.template
And the resulting .htaccess:
http://blogs.bwerp.net/archives/htaccess
Sounds like you determined that the IT webserver does not support mod_rewrite, or at the very least it doesn't allow it in your .htaccess. Personally, I think it's something worth making some noise over, especially with a blog as linked to as yours.
Cheers.
So what does mod_rewrite buy me that redirect permanent doesn't?
I wasn't aware of `redirect permanent' until your previous comment. They seem to do the same thing in this situation. I would expect that `redirect permanent' requires less overhead than mod_rewrite, since mod_rewrite is built for conditionals and regexes and such, but don't quote me on that.
So, carry on. O=)