Trevor Burnham

Sure, it works in practice…

Boycott www!

January 14th, 2010

There was a dark chapter in the early history of the Internet when, any time you wanted to go to a website, you had to painstak­ingly type “www.” in front of its domain name. This served a purpose of sorts: It told the server, in no uncer­tain terms, that you wanted to surf the World Wide Web. Never mind that the http:// prefix already said as much; Internet con­fig­u­ra­tion was a dark and untested art, and it just seemed safest to use sub­do­mains like www and ftp to be clear about which of your servers people were con­nect­ing to.

But then, as the mil­le­nium came to a close, and non-​​protocol related sub­do­mains like webmail and blog began to pro­lif­er­ate, the www prefix began to fade away. To be sure, it remained on many sites as a ves­ti­gial reminder of the days of dial-​​up and Netscape Nav­i­ga­tor, but most of the web’s denizens had learned that it could be safely for­got­ten. As hip new­com­ers like Twitter and foursquare dropped the prefix alto­gether, the augurs seemed clear: www was going gently into that good night.

Or was it?

Yes­ter­day, someone posted to Hacker News that the domain nasa​.gov is broken. You have to put www in front of it, or it won’t work. (Note that many browsers, like Firefox, auto­mat­i­cally put www. in front of the domain you enter if it can’t reach it without it. But the most popular browser, Internet Explorer, doesn’t.) I replied that it had to be a tem­po­rary glitch—some idiot added a new sub­do­main to their DNS records and acci­den­tally deleted the root!—but no, someone else pointed out, army​.mil and navy​.mil suffer from the same issue. It’s like they don’t want recruits who don’t habit­u­ally triple-​​tap ‘w’ before every web address!

Look: www has got to go. It’s a waste of bytes and time, our nation’s two most valuable resources. If you own a domain, here’s how to fix the problem:

  1. Find your name­server settings, specif­i­cally your A records. Make sure that your root domain is pointing to the same IP address as your www subdomain.
  2. Redirect www.yourdomain.com/whatever to yourdomain.com/whatever. If you’re using Apache, you just need to add the fol­low­ing to either your con­fig­u­ra­tion or a .htaccess file in the domain’s document root:


    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com.* [NC]
    RewriteRule ^(.*)$ http://yourdomain.com$1 [R=301,L]

That’s it! Now if anyone tries to use www, even in a link to a specific page, they’ll still get to the right place. It’s so easy, even a rocket sci­en­tist could do it.

P.S. If you absolutely must keep www, at the very least allow those who omit it get where they’re trying to go. To do this, just modify the instruc­tions above by using these lines in your Apache config instead:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com.* [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com$1 [R=301,L]

This is what Facebook does, for instance. But just as they dropped their super­flu­ous “The” (remember?), rest assured that there will come a time when Facebook​.com will truly stand alone.

Tags:   1 Comment

1 response so far ↓