As Jai noted, I’ve switched the site over to PHP. That’s not the only thing I got done today. ![]()
Mark Pilgrim recently wrote another reminder that gzip-compressing web pages can save you some serious bandwidth. Unfortunately, this requires some magic with Apache which I can’t seem to cast. However, Dean Allen pointed out that you can use a PHP function to gzip-compress your site on the fly. Gzip compression is supported by pretty much all modern browsers that matter (ones that don’t support it are given a regular uncompressed web page, anyway) and can reduce your bandwidth by half. Spiff.
Speaking of Dean, his Refer tracker runs on PHP as well. In order for it to track page hits, though, you have to have a PHP tag in each of your documents. This isn’t a big deal with MT templates, but, in order to get it to work with my site, I either had to override my .htaccess file to process HTML files as PHP, or migrate to PHP entirely. I’m not allowed to modify .htaccess files with my web host, so that leaves me with the inevitable choice to migrate. It took about a half-hour to pound out all of the details. The end-result is visible over here.
The new URLs were an inevitable conclusion of moving to PHP. I mean, if I’m going to change my URL structure, may as well go all out, right?
In particular, I wanted to future-proof the URL structure from any future changes I might make to the site (like if I ported over ASP.Net or something–gack!). A search for future-proofing URLs in Movable Type brought me to Már Örlygsson’s helpful tutorial.
Finally, being a good netizen, I wanted to make sure all of my old inbound links still make it to their original content. I mean, not like I have a lot of them, so the ones that I do have I don’t want to disappoint.
What I did to solve this is create another Individual Archive simply called “Boing.” It uses the old URL structure (<$MTEntryID pad="1"$>.shtml) to create a page which then redirects the user to the new page with this meta tag:
<meta http-equiv="Refresh" content="0; URL=/archives/<$MTArchiveDate format="%Y/%m/%d"$>/<$MTEntryTitle dirify="1"$>/">
I thought about making this a temporary fix, removing it after about a year or so, but it’s relatively harmless in terms of disk space and just maintains itself. I mean, a couple hundred bytes of data per entry and it keeps Our Story from massive link rot.
All that being said, though, a big part of the reason I switched to PHP was that I want to get back into some sort of development again. Web sites and databases are pretty much all I get to work with these days, so I thought, “why not?” Make Our Story PHP-based and mess around and have fun. Who knows? Maybe I might even end up coding the Ironworks web portal by hand. ![]()
10 Comments
Ken, could i make a request on your referrers page?
Those of us that are showing up as a straight IP address, could you um, hide those?
If you want, you can do anything that has a 157.182.xxx.xxx as WVNet or WVU or something.
Good deal on Moving to PHP
Altp.
Ken,
Why not use a 301 page instead of a meta tag?
Permanent relocation is better than maintaining meta pages.
And when you say moving to php, you mean within movabletype right?
Mike, I’m not sure if I can. Let me try to find out…
Ryan, I thought the only way to produce HTTP codes was with .htaccess files…is that right? Or is it possible to produce a page that generates a 301?
BTW, I’m still using MT–only my templates have a .php extension now.
Ken, your “Boing” sent me to a 404- here’s the test link for you: http://www.kennsarah.net/archives/000313.shtml
Jai, thanks. This is fixed.
Nice K, looks good- now make it 3D http://www.homestarrunner.com/sbemail80.html
But what’s with the Recent Conversation section? Somehow your comment is embedded in mine. Weird.
Ken,
Good point. That may be. That said, it’s easy to generate a 404. ;P
Maybe you need a host that doesnt mind reasonable .htaccess usage.
Oh - and the front page says this article has 7 comments as i post this. but there are only 5 here. A bit of weirdness there.
In regards to the Refer tracker, is there anything that can print out a list of referal pages that can be put universally on all pages on one’s site? IE like how I define my external css. I couldn’t find a way to contact the author (and I’m at work and bored heh) and was wondering if you could shoot me an email sometime. It would be great to link to those nice enough to link back to those who send folks my way.
After a little (and very lucky digging) I answered my own question…
downes.ca/referrers.htm

John, you may also find Dean Allen’s Refer program of use:
http://www.textism.com/tools/refer/
Spammers, unfortunately, have found ways to abuse refer as well. I’ve had “referring” hits to my site that don’t actually come from real people. Instead, bots are sent out to post fake hits so their “referring” sites (usually affiliated with gambling or porn) get free advertising on our referrer list:
http://www.kennsarah.net/about/refer
Refer lets you filter on keywords to prevent such abuse, but I periodically have to update the filter with new keywords and purge our referring database of the offending entries.
Refer requires PHP and MySQL.