Remembering 9/11

Two years ago today, the world was stunned by terrorist attacks in which hijacked airliners brought down the World Trade Center, damaged the Pentagon building, and resulted in the crash of a fourth plane in Pennsylvania. Here in the US, flags flew at half-mast for weeks on end, and I’ll probably never again be able to see a flag at half-mast without remembering the sense of mingled sorrow and determination that swept our nation during that time.

Redirection

I mentioned earlier that I have converted my site to WordPress, and set up link redirection for the old links. There’s some discussion going on over at Alex’s site about this subject as well. I figured I’d put up some notes about what I did.

First of all, for a couple of static links, like for my RSS files, I just added some redirect directives to my .htaccess file, like so:

# redirect the old MyPHPBlog RSS locations to the new WordPress ones:
RedirectPermanent /myphpblog/rss.php https://dougal.gunters.org/b2rss.php
RedirectPermanent /myphpblog/rss2.php https://dougal.gunters.org/b2rss2.php

That part was easy enough. But the hard part is redirecting old permalinks and comment links. Both systems use querystring parameters, and they use different variable names and formats, plus the MPB stuff was all under a subdirectory:

MyPHPBlog Permalink
https://dougal.gunters.org/myphpblog/archive.php?y=2003&m=09&d=05#pid273
WordPress Permalink
https://dougal.gunters.org/index.php?m=200309#post273
MyPHPBlog Comment
https://dougal.gunters.org/myphpblog/comments.php?eid=273
WordPress Comment
https://dougal.gunters.org/index.php?p=273&c=1#comments

The first thing that comes to mind is to use Apache’s mod_rewrite functionality. However, as others have noted, mod_rewrite doesn’t have access to the query string. My URI rewriting needs were also more complicated than Matt’s, so I decided to borrow some ideas from php.net’s url shortcuts.

I do this by using a custom 404 error handler in my .htaccess:

ErrorDocument 404 /redirector.php

Then, I wrote a redirector program in PHP that gets the name of the requested file and the querystring variables, and sends the browser a permanent redirect, or a real 404, as necessary. It should be fairly easy for me to extend the redirector as necessary to accomodate other URLs, if needed.

Axis of Weevil

Yay, I’m in!

CONGRATULATIONS, Dougal, and as with all of our new members, you will receive your very own World Famous Axis of Weevil Gift Pack, containing a slab of Dreamland ribs, a gallon jug of Milo’s sweet tea; a G-Lox Wedgee gun rack from Mark’s Outdoor Sports for your sweetie-pie’s Explorer, a package of Bubba’s Beef Jerky (according to Dr. Weevil, this is homemade and is available only at the gas station at the end of Highway 82 in Bibb County); a three piece, 24 ounce box of Priester’s Pecan Logs; a box of Jim Dandy grits; a 16 ounce bottle of Dale’s Steak Sauce; AND a six pack of Buffalo Rock Ginger Ale.

Hey, that sounds almost as good as a Rick & Bubba Love Pack! I promise to execute my Weevil duties faithfully, and I’ll stay away from the goats from now on.

Alabama Highland Games

You know, it’s silly of me to have mentioned it in a comment over on Possumblog and not on my own blog… But the Alabama Highland Games are coming up next month. Saturday, September 27th. Clan Campbell is the honored clan this year, so you’ll probably have the opportunity to see Susan and me marching on the field. Well, again. Susan and I have marched with Clan Campbell a couple of other times.

So far, this summer has been uncharacteristically cool (for southern Alabama), so we’re hoping to have some really nice weather. Start planning your trip to Montgomery now. Kilts, and bagpipes, and haggis, oh my!

Training Day

Around 9:05 this morning, my department’s Director came by my cubicle this morning and said, “Aren’t you supposed to be in a class right now?” I gave him my best blank stare (which was very easy since I had no idea what he was talking about) and said, “What class?” So he says, “Monday through Wednesday, from 9:00am to 4:00pm? You’re signed up for the iSeries training.” I blinked. “Training?” Internally, I was grepping my mental rolodex, trying to dredge up even the faintest memory of what he was talking about. I quickly scanned my Outlook calendar to make sure I hadn’t missed a reminder, but I was still sans clue. We went back and forth like this for a bit longer, until we finally decided that somebody must have forgotten to notify me about this class that they signed me up for. Either that, or they only notified me verbally, and I forgot to set a reminder for myself. But I feel pretty sure that it’s the former case.

So, I grabbed pad and paper and quickly trudged over to the building next door, where said training was taking place. I was mentally grumbling to myself on the way over about having to waste time on a class when I had some other work I needed to get done. But the training was some hands-on stuff, and we have a good instructor, and it will definitely be useful later, so my mood lightened quickly. I just don’t like surprises like that — I prefer my spontaneity to be better planned 🙂