Apache Rewrites
Posted in Tech
Last dog watch, 1 bell (6:58 pm)

I recently discovered the joy of mod_rewrite in Apache2. After much hardship, we finally convinced the powers-that-be to allow us to use the .html extension instead of .htm. Unfortunately that meant I had to create a way to let people load the new content moved. With mod_rewrite, it’s a piece of cake:

Under the virtual host configuration section, add:

RewriteEngine On
RewriteRule ^(.*)\.htm$ $1.html

Now the only downfall to this method is that you can’t return a 301 code (permanent move) with a regex like that. Anyone pulling up the .htm file gets a copy of the .html file, but doesn’t know that it moved, and search engines won’t update their indices appropriately. But you can write a specific rule for each important page that will make them change, like this:

RewriteRule ^/path/to/file.htm$ /new/path/to/file.html [R=301]

And voila!, you’re done. See how easy that was?

Leave a Comment »
Good For a Laugh
Last dog watch, 1 bell (6:34 pm)

It’s not often that I laugh out loud at someone’s blog post, but I just did at this post by Richard Bartle.

A red hand means that if you step off the pavement (”sidewalk”, colloquially), you have to make a saving throw versus traffic or take a massive reduction to your hit points.

Leave a Comment »
Website Woes
First dog watch, 4 bells (6:29 pm)

Today at the office our website designer was updating one of our sites when his machine died. He was running a box with striped RAID drives on it, and something happened to the array, but it crashed and left the website in a mid-update state that wasn’t working. What’s worse, it was serving out some pages with includes that didn’t exist, so very quickly the server ran up to its maximum number of threads serving out 404’s. Once I tracked down the problem, I shut that site down (so our others wouldn’t be affected) and got to work re-publishing the changes.

Since the content was stored under source control (Perforce—I highly recommend it), all I had to do was sync my computer to the latest version and upload it myself. Unfortunately, it was over 1700 files. So I tar‘d them up, then bzip2‘d the tarball and burned it to a CD and drove down to our colocation facility. It was faster than trying to scp the 450Mb file over our T1 connection. So I got the site up and running in about 20 minutes.

Back at the office, I had to find out what happened to the machine that went down, turns out a quick pop into the RAID BIOS fixed it just fine. It took about 5 seconds to repair. I typically do get the most done at work between 5 and 6pm.

Leave a Comment »
Shelf Action
Posted in Hobbies
Forenoon watch, 3 bells (9:37 am)

Last weekend I spent my spare time building our pantry under the stairs. My under-stair area is much bigger than you would think, with room for two six-foot shelves twelve inches deep on both sides, and still room to walk between them. I have one more shelf rail to put up before I can screw all the shelves into place. Then all I have left is to put a door on it.

Leave a Comment »
Serenity was GREAT
Forenoon watch, 2 bells (9:28 am)

I really liked Serenity, it was a great movie. I don’t care much for them killing a few characters off, but I guess they have to do that sometimes. I really wanted to know what was up with Shepherd, but they never answered that. I sincerely hope the SciFi channel can acquire the rights and let them make more episodes, that show was truly too short-lived.

And if you really need to say it, get the t-shirt.

1 Comment »