<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>unitstep.net &#187; http</title>
	<atom:link href="http://unitstep.net/blog/category/http/feed/" rel="self" type="application/rss+xml" />
	<link>http://unitstep.net</link>
	<description>the home of peter chng</description>
	<pubDate>Tue, 30 Dec 2008 19:37:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Taking the www out of the web</title>
		<link>http://unitstep.net/blog/2006/12/27/taking-the-www-out-of-the-web/</link>
		<comments>http://unitstep.net/blog/2006/12/27/taking-the-www-out-of-the-web/#comments</comments>
		<pubDate>Wed, 27 Dec 2006 18:47:32 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
		
		<category><![CDATA[fix]]></category>

		<category><![CDATA[htaccess]]></category>

		<category><![CDATA[http]]></category>

		<guid isPermaLink="false">http://unitstep.net/blog/2006/12/27/taking-the-www-out-of-the-web/</guid>
		<description><![CDATA[Despite the phrase &#8220;World-Wide Web&#8221; being as dated and passÃ© as claims of Al Gore &#8220;inventing the Internet&#8221;, the term persists today as the most popular and unnecessary subdomain for websites.  Should it really be necessary to type &#8220;www&#8221; before every domain name?  Furthermore, does it even have any more relevance?
Since the major [...]]]></description>
			<content:encoded><![CDATA[<p>Despite the phrase &#8220;World-Wide Web&#8221; being as dated and <i>passÃ©</i> as claims of Al Gore <a href="http://en.wikipedia.org/wiki/Al_gore#1999_CNN_interview">&#8220;inventing the Internet&#8221;</a>, the term persists today as the most popular and unnecessary subdomain for websites.  Should it really be necessary to type &#8220;www&#8221; before every domain name?  Furthermore, does it even have any more relevance?</p>
<p>Since the major use of Internet is for accessing websites, the &#8220;www&#8221; prefix shouldn&#8217;t be needed anymore.  It is an archaic holdover from a previous era, one where browser wars meant IE vs. Netscape and where Geocities was <em>the</em> place to be.  Thankfully, the folks over at <a href="http://no-www.org/">no-www</a> have been aiming to improve this for some time.</p>
<h3>So what&#8217;s the big deal?</h3>
<p>Well, it&#8217;s not such a big deal, more just a pet peeve of mine.  Most sites out there are thankfully configured well enough so that navigating to &#8220;domain.com&#8221; just redirects you to &#8220;www.domain.com&#8221; with no damage done.  However, some servers are setup so that navigating to &#8220;domain.com&#8221; <em>doesn&#8217;t</em> work, and this forces you to type in the &#8220;www&#8221; subdomain before.  This really doesn&#8217;t make sense in today&#8217;s world.</p>
<p>In my opinion, all websites should be set up with the no-www version as the default.  Using the &#8220;www&#8221; subdomain should redirect you to the no-www version, with no harm done.  This is known as <a href="http://no-www.org/faq.php">Class-B compliance</a>, according to the no-www folks, and it&#8217;s probably going to be the best way to go for some time, since many people still use the &#8220;www&#8221;, after having the phrase drilled into their heads during the late 90&#8217;s. </p>
<h3>So, how to fix it?</h3>
<p>If you&#8217;ve signed up for hosting from a provider, chances are they&#8217;ve already implemented some sort of compliance, but not the optimal type.  For example, most hosting providers will automatically redirect the no-www request to the www one.  So, under this configuration, someone entering &#8220;domain.com&#8221; would be redirected to &#8220;www.domain.com&#8221;.  No big deal, but things could be better.  After all, the no-www version is shorter and thus requires less typing and less space.  Good if you want to save a few cents on your business cards.</p>
<p>Fixing it is a simple effort that takes a minute or so.  All you have to do is edit the <code>.htaccess</code> file in the root of your website, if you&#8217;re using Apache.  Here&#8217;s the following directive I&#8217;m using.</p>
<pre>
<code># BEGIN no-www
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.unitstep\.net$ [NC]
RewriteRule ^(.*)$ http://unitstep.net/$1 [R=301,L]
&lt;/IfModule&gt;
# END no-www</code>
</pre>
<p>The <code>RewriteRule</code> uses a 301 - this is a special <acronym class="uttInitialism" title="HyperText Transfer Protocol">HTTP</acronym> code used to tell of a permanent redirection.  Browsers and search engines crawling your site will interpret this as an instruction that your website has permanently moved to the non-www address.  This is most important for search engines, so that they know that the no-www version is not <a href="http://googlewebmastercentral.blogspot.com/2006/12/deftly-dealing-with-duplicate-content.html">just a duplicate</a> or different website than the previous www version.  The 301 instruction tells them that the old www version doesn&#8217;t exist anymore, and it has been moved to the no-www address. </p>
<p>Taking it a step further, you could also redirect <em>any</em> subdomain to just the root.  For example, I also own the domain &#8220;peterchng.com&#8221;, and wanted to redirect any request to that address, subdomains included, to my main site.  Here&#8217;s the directives I used.</p>
<pre>
<code># BEGIN peterchng.com FORWARD
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(([a-zA-Z0-9]+)\.)*peterchng\.com$ [NC]
RewriteRule ^(.*)$ http://unitstep.net/$1 [R=301,L]
&lt;/IfModule&gt;
# END peterchng.com FORWARD</code>
</pre>
<p>Go ahead, try typing in <a href="http://who.the.heck.is.peterchng.com">&#8220;who.the.heck.is.peterchng.com&#8221;</a> into your browser, and you&#8217;ll see it redirects right back to this site.</p>
<p>You&#8217;ll want to be careful when using these directives - if you actually do have separate websites on different subdomains, they&#8217;ll be inaccessible if you do this!  I&#8217;ve been using it until I find a use for peterchng.com - or a different use for unitstep.net.  </p>
<h3>Why all the trouble then?</h3>
<p>With all the trouble of going of removing the &#8220;www&#8221; you may wonder why it was ever used in the first place.  Well, IIRC, in the early years of the Internet, websites or <acronym class="uttInitialism" title="HyperText Transfer Protocol">HTTP</acronym> wasn&#8217;t the main use.  Other services/protocols such as gopher, FTP and telnet were probably a lot more dominant.  So, it made sense to set up a separate subdomain that would be used to accept <acronym class="uttInitialism" title="HyperText Transfer Protocol">HTTP</acronym> connections.  This would make it easier for users to distinguish between the services offered from a particular domain.  However, since <acronym class="uttInitialism" title="HyperText Transfer Protocol">HTTP</acronym> has grown to eclipse those traditional services, the use of www is almost superfluous nowadays.</p>
<hr/>Copyright &copy; 2009 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2006/12/27/taking-the-www-out-of-the-web/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
