Archive

Archive for April, 2009

And permalinks are working (sort of)

April 5th, 2009
1 comment

The Apache mod_rewrite module provides a nifty little way to redirect URLs by rewriting them on the fly at the server level. Whip together a little regular expression to parse the incoming URL, construct a new destination URL for it, and presto — seamless transition. So, for example, an old link to the RSS feed like . . .

https://tenreasonswhy.com/weblog/atom.xml

. . . gets transformed on the fly to this . . .

https://tenreasonswhy.com/weblog/feed/atom/

. . . so I don’t think I’ll be breaking your feeds.

That’s all well and good when the incoming URL has the data you need. Unfortunately, Ten Reasons Why has gone through being originally hosted on Blogger’s blogspot.com way back in 2000, to being managed via Blogger but FTP’ed to an account on my at-the-time dial-up ISP Mindspring, to being hosted on tenreasonswhy.com through several different versions of Movable Type. And apparently, I wasn’t really very diligent about making sure the permalink approach was consistent among all of those changes.

A good number of the old posts in this blog have permalink URLs that, while based on the title of the entry, have been truncated in some fashion. For example, in some past version or configuration of Movable Type, the permalink URL for an entry titled “Wireless Saves The Day” became . . .

https://tenreasonswhy.com/weblog/archives/2003/12/wireless_saves.html

. . . but in WordPress that URL uses the full title, thus is:

https://tenreasonswhy.com/weblog/2003/12/wireless-saves-the-day/

. . . which is a fine and attractive URL, but finding a regular expression that will magically add those missing words is, well, impossible. Given only “wireless_saves.html” as the incoming location there’s no way to reconstruct “wireless-saves-the-day” out of that.

So, as a workaround, all of the old Movable Type permalinks (which are all distinguished by the “archives/” directory) now point to the monthly archive instead of to the individual entry. Therefore, the old MT permalink . . .

https://tenreasonswhy.com/weblog/archives/2003/12/wireless_saves.html

. . . will now automagically redirect to the archive page for the appropriate month here in WordPress-land:

https://tenreasonswhy.com/weblog/2003/12/

For the most part, that shouldn’t be a major problem for actual users, since, except for a few years between 2003 and 2006, when I was really active, few months have more than a handful of posts. It’s going to hork up my referrer stats, but you don’t really care about that, do you? :-)

And, in any event, that’s plenty of thinking about regex for a sunny spring afternoon. Off to the outdoors!

Uncategorized , ,

Feeds Are Working

April 5th, 2009
No comments

Feeds appear to be working now. Permalinks for old posts . . . not yet. :-/

Uncategorized

Up and Running Again

April 5th, 2009
No comments

So that migration between web hosts took a bit longer than expected, but turns out the issue was PEBKAC — I had to flip a switch in the new host to get it to use the new domain name servers.

Things are up and running again, though you’re probably not aware of it because I’m pretty sure no one actually comes to this web site directly anymore. Anyone who might be reading is probably reading via the RSS feed . . . but that’s probably not working. See, I’ve migrated this weblog from Movable Type 3.something-or-other to WordPress 2.7.1, and in the process have managed to munge all the URLs.

WordPress handles URLs differently than Movable Type, and I haven’t figured out (yet) how to rewrite the old Movable Type-style URLs to point to the new WordPress-style URLs.

On top of that, WordPress apparently doesn’t like the way that Movable Type did paragraph breaks, so all of the paragraphs in old posts are all mushed together. I’m hoping I can correct that with some CSS hackery and that I don’t have to try any SQL manipulation of the data.  Me writing SQL statements: not pretty.

Anybody with awe-inspiring Movable-Type-to-Wordpress migration skills, feel free to get in touch.

Uncategorized