One special link

When I was updating my links today, I was in for a big surprise.

Wes Packer has been quitely blogging away while I wasn’t looking, building up an impressive set of links and chronicalling his life since he left the world of stand up comedy and Microsoft programming and joined me in the glorious world of Open Source. (Which is quite a coup, considering it was Wes would took me through the back of the wardrobe to Narnia some years ago!).

He’s even been Twitter-ing, which I’ve been too lazy to do as yet.

Well worth a read for Wes’ trademark mix of tech, politics, philosophy, and Wesishness.

Migrating from Drupal to WordPress without losing indexation

Moving this site from Drupal 4.x to WordPress 2.7, I was obviously concerned with losing indexation of my old Drupal URLs from search engines.

As I had not set up clean URLs on my Drupal website for a lot of my content, I needed a quick and easy way of ensuring that any traffic destined for one of my Drupal pages firstly found it’s way to the original content (as not everything has moved over to the new site) and secondly informed my users that the site had been moved.

Enter the 301 redirect, the safest way to redirect both users and search engines.

As I was not using clean URLs, the majority of my Drupal hits where coming in the form http://www.planetofthepenguins.com?q=node/… . It’s the q= that’s key – WordPress doesn’t use this parameter and so I can safely assume that when I see it, it means the browser wanted a page from the old site.

So, having pointed a new subdomain (http://old.planetofthepenguins.com) at my old Drupal site, the code to perform the automatic redirection is simple …

<?php
$drupalq = $_GET['q'];
if ($drupalq){
header(“Status: 301 Moved Permanently”);
header(“Location:http://old.planetofthepenguins.com?q=” . $drupalq);
exit;
}
?>

This code

  1. Grabs the “q” parameter from the URL into a variable
  2. Checks this variable and if it has been set
  3. Writes a 301 redirect to the HTTP return header
  4. Writes a location into the HTTP return header
  5. Prevents the rest of the page from being rendered

All that remains now is to put a prominent message on my old site that I have moved to a new platform and provide my users with a link to click.

Oh, and set up my Permalinks in WordPress!

The Porn Star and The Chicken

Written for Mr and Mrs Meanie, sometime ago, whilst signing in Comic Guru.

“So, how does it work again?” asked Helena, nervously sipping her latte.

The technician didn’t look up from the machine, a Victorian nightmare of cogs, gears, sprokets and springs.

“I mean … biologically …” Helena continued, “Is it even possible?”

“No,” grunted the technician, “I spend eight hours before every shoot tuning this thing for it NOT to work.”

Helena shuffled her feet. She had done it all, so she thought, seen it all, and had it done to her again. Somehow though, this small, greasy man with this machine made her nervous. Even fully clothed, he made her nervous.

“And how DOES it work?” she asked weakly.

The technician lifted his two ended screwdriver like a conductor’s baton.

“You,” he said, “Here.”

The baton landed on something that looked like two seats fighting each other.

“The rooster,” the technician continued, “Here.”

The baton landed on what appeared to be a tube with bicycle clips attached.

“That’s a weird stage name,” said Helena.

“Yeah,” grunted the technician, “Whatever.”