(Skip to Content)

Star Trek Minutiae's April Fools Day 2003 Prank

April Fools Day Screenshot

After neglecting to plan a prank for April Fools Day 2002, I resolved to find something really fun for my 2003 joke. In February, I first started working on finding ways to preserve my bandwidth from illegal hotlinking by using the Apache mod_rewrite module. Although I didn't start working on a joke at the time, I was very intrigued by the module's ability to discern a visitor's browser (aka "user agent") and make changes to web pages based on the browser. Being an ardent Macintosh fan, I got the idea of a pro-Mac April Fools Day joke.

Apple's new Safari browser came out in January, and I'd been using it as my default browser almost since the day it came out. Although close to 95% of all my visitors are on the Windows platform, I thought it would be fun to thumb my nose at the Microsoft Monopoly and make my site for Mac users only. And so after learning how to set up the server redirect with mod_rewrite, I set a condition that any visitor not using Safari would be automatically shunted away from my front page and confronted with an ominous notice about changing my site management policy. If anyone took the time to read the notice and did not immediately realize what day it was, I expect they were first annoyed, then confused, and then completely befuddled.

I was not completely heartless, though, so I set a JavaScript notice to load upon exiting the page:

JavaScript Message

If you really want to see the whole page and read my long, absurd notice, you can find it here.

How I Did It

During my experience about two months ago in learning how to use the Apache mod_rewrite Module, I discovered that the server can be configured to detect which browser "user agent" a visitor is using. With a simple four lines of code, I was able to tell the server to automatically redirect all non-Safari users to the fake notice page.

RewriteCond %{REQUEST_URI} ^/index.shtml$ [NC]
RewriteCond %{REQUEST_URI} !^/.*/index.shtml$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*Safari.*$ [NC]
RewriteRule .*index\.shtml$ http://www.st-minutiae.com/notice.shtml [R]

That's all there was to it!

This page was last modified on Friday, February 08, 2008.