psst.. this blog is on hiatus.

A (hopefully) seamless migration from underscores to hyphens

I’ve become a little too interested in SEO of late, and I learned that hyphens are preferred by Google to underscores. (By the way, many people erroneously label hyphens as dashes; they are two distinct things.)

It seems that Google actually indexes a URL containing sample_phrase as the text jumbled together, or samplephrase. Therefore, for a searcher to find these terms in the URL of your page, he would have to search for the exact text: “sample phrase”. However, with hyphenated URLs (sample-phase), Google properly parses out each individual word, allowing a user searching for sample or phrase to hit that page.

So, with that in mind, I decided to make some changes ’round here to page names. And create a lot of work for myself on a Sunday afternoon.

All of my Individual Entry Archives in Movable Type used underscores to separate words in the filename, since this is MT’s default. I switched this to dashes using the handy Dashify plugin. And then I thought, while I’m at it, why don’t I get really neurotic about SEO and cut down on my URL length? The jotsheet URLs have always been long, and the “content” prefix was superfluous, so I got rid of it.

URLs: Old to New

Old URL
http://underscorebleach.net/content/jotsheet/2004/05/this_is_a_page
New URL
http://underscorebleach.net/jotsheet/2004/05/this-is-a-page

Making it seamless…

But being the über-nerd that I am, I had to make the transition seamless. That means if you hit one of the old pages, it’ll kick you right over to the new one. I had to dust off my .htaccess skills and think a bit about the “cascade” of cruft URLs I’d need to address in that file. I also learned that it’s better to do a 301 Redirect than a normal Redirect, since this informs the client that the content has moved permanents (and probably preserves PageRank), so most of my RewriteRule's end in [R=301,L] rather than [R,L]. The final result was ugly, but I don’t think a better way exists; looks like this fellow had to do just about the same thing.

To check that the 301 Redirects were working properly, I used Rex Swain’s HTTP Viewer. You’ll see by attempting to load the old URL of my review of SharpMT, a jotsheet entry from October 2004, that Apache is properly passing a 301. The current location of the SharpMT review is here.

To finish it all up, I had to change the Weblog Config in MT and do a full rebuild, which takes about an hour and a half (ok, just slightly less). I also had to change the SSIs I use on the rest of the site—yes, my website is a strange hodgepodge of MT-created SSI and user-created SSI, all kept together with string and duct tape—so I wasn’t linking to old pages. It wouldn’t have been the end of the world if I had been, since the .htaccess would have caught these errors.

Did I screw up?

That’s a lot of work for a stupid little change, isn’t it? I don’t even know if it will improve my ranking in Google. But if nothing else, it gives me cleaner URLs. I actually happen to prefer underscores as delimiters to hyphens, since I take the underscore as denoting a space (not delimiting a hyphenated word), but as in all things WWW: we must follow convention.

The question, though, is did I leave something out? Forget something? Screw up my .htaccess? If you see errors or 404’s, tell me! And by the way, if your RSS feed has new items that aren’t really new, this is probably why.

Hey, if all goes well, I should be rockin’ the #1 slot for “tara reid boob” soon! This is important stuff, baby!

4 Responses to “A (hopefully) seamless migration from underscores to hyphens”

  1. 1
    The Daily Dump Says:

    Optimising Movable Type for Google

    For those that like to tinker, I found this enlightening post on optimising Movable Type for Google while looking for something else. A quick search found quite a bit on the topic (see links below). I decided to implement some…

  2. 2
    Lubayala Says:

    information …
    alaska fishing+ king petersburg salmon

  3. 3
    Ljwqoala Says:

    information …
    alaska salmon fishing+

  4. 4
    Kjbeiala Says:

    Greetings!..
    fishing+ florida fly guide guide key