I’m a Geek

I’m very happy. I braved the wilds of mod_rewrite long enough to finally smooth over the transition from my old blog software to the new.

See, with my current software, the address for a particular post looks something like this: <http://www.striderweb.com/blog/1>. (That’s the address for the first post — #1).

With Greymatter, my old blog software, the link looked like this: <http://www.striderweb.com/blog/archives/00000001.htm>.

To further complicate things, when I first switched to WordPress, I left in the “archives” part of the addressing, giving us this style of address: <http://www.striderweb.com/blog/archives/1>.

That’s three distinct types of addressing. Three different addresses for every page that existed using my old software — almost a hundred pages. As is common with the web, other sites have linked to mine over the couple years I’ve been blogging, so it would be unneighborly (to say the least) to just switch over my links and leave any incoming “old style” links hanging. What to do? My first (relatively unsophisticated) response was to put up a page for ever single old entry, that in essence read “Hi — this page has moved to <here>” with a link to the new-style address. It was clumsy, but reasonably effective.

But the kludginess of that bothered me, for a couple of reasons — first, I wanted visitors to be redirected seamlessly to the page they wanted, and second, that same seamlessness would smooth over the transition with regards to all those search engines out there if I could only fit a 301 redirect (e.g. “this page has permanently moved”) into the mix somewhere.

So… to make a long story short (I know I know… too late!) I’ve set up the server to “rewrite” any old-style URL in /blog/archives/… to a nonexistent “redirect” directory (for example, “/blog/archives/00000001.htm” is rewritten to “/blog/redirect/1”), and then use a plain old 301 redirect to point anything addressed to “/blog/redirect/” back to plain old /blog/. Thus, clicking on any of the following:

ultimately takes you to the same address, http://www.striderweb.com/blog/1, and if a search engine pointed you to the old-style address, my server tells the search engine that the page has moved and to update its info.

I have no doubt that anybody reading this falls into two groups… those who find it interesting and have made it this far, and those who stopped reading after the first short paragraph. As I said, I’m a geek — I find this stuff fascinating. Considering how much I’ve heard about how hard it is to learn mod_rewrite, I’m amazed how quickly I figured it all out, but it seems to be working perfectly. (I was already familiar with Regular Expressions, which was a huge headstart!)

Off to bed.

Comments are invited and encouraged

Anti-Spam Quiz: