I said no to WWW; So can you

Posted by sh1mmer on Mar 31, 2007 in General |

A while ago the excellent Simon Willison linked to the No-WWW campaign. It’s been on my to-do list, but no more, it is complete.

The gist is that www.domain is redundant as all Web traffic already uses HTTP already. Since no other protocols (mail, FTP¹) insist on a specific sub-domain the Web shouldn’t either.

Implementation is pretty easy whack these rules in your Apache config or .htaccess file.


<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]

RewriteRule ^(.*) http://domain.com$1 [L,R=301]

</IfModule>

Obviously replace domain.com with your own domain, without forgetting to escape the . in the Rewritecond. Thanks to Big Stu for helping me get the rules tweaked. This one will issue a 301 redirect, which will also help your Google ranking. Any links to www.domain.com and domain.com will get consolidated into one source of true in Google’s eye thereby making your site maximally optimised.

¹ FTP came closest to having a specific sub-domain. A lot of hosting companies still insist on using ftp.domain.com for FTP access.

Technorati Tags:
, , , ,

Share and Enjoy:
  • del.icio.us
  • Digg
  • Ma.gnolia
  • Reddit
  • StumbleUpon

 
close Reblog this comment
blog comments powered by Disqus

Copyright © 2009 Kid666 Blog All rights reserved. Base theme by Laptop Geek.