<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tech-Recipes - Latest Comments in Rewrite domain.com to www.domain.com using htaccess in Apache</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><atom:link href="https://tech-recipes.disqus.com/rewrite_domaincom_to_wwwdomaincom_using_htaccess_in_apache_apache_web_server_tech_recipes/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 13 May 2011 13:04:25 -0000</lastBuildDate><item><title>Re: Rewrite domain.com to www.domain.com using htaccess in Apache</title><link>http://www.tech-recipes.com/rx/296/rewrite-domaincom-to-wwwdomaincom-using-htaccess-in-apache/#comment-203133500</link><description>&lt;p&gt;Oh and, if it's good enough for FACEBOOK.COM which re-routes to &lt;a href="http://www.facebook.com" rel="nofollow noopener" target="_blank" title="www.facebook.com"&gt;www.facebook.com&lt;/a&gt;, THEN there is obvious reason for it. Let's see, Aaron Toponce versus $9 Billion Valued Company. Let the masses decide, what is redundant&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hal_9000_ai</dc:creator><pubDate>Fri, 13 May 2011 13:04:25 -0000</pubDate></item><item><title>Re: Rewrite domain.com to www.domain.com using htaccess in Apache</title><link>http://www.tech-recipes.com/rx/296/rewrite-domaincom-to-wwwdomaincom-using-htaccess-in-apache/#comment-203132381</link><description>&lt;p&gt;It's not silly nor redundant if you are the one running and owning the server and the dedicated IP address running to it. The choice to force content to be served from one NameHost is a valid one, especially if you Host several domains. Anyone that has worked with servers and DNS knows that anyone can point their domain to your Dedicated IP address, and without such technology as mod_rewrite available at the domain root level, someone can essentially server your content under their domain name in a web browser. It is common practise with Domain Harvesters. Anyways, my point is that what is absurd and/or redundant to someone, usually means it the reasoning may be over their head. If we talking about apples and we're looking at an Macintosh Apple and a Granny Smith Apple, you just see Apples, I see apples and computers and my Grandma Smith. Difference is really, I OWN the apples , while you're just talkin abot it ;)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hal_9000_ai</dc:creator><pubDate>Fri, 13 May 2011 13:01:47 -0000</pubDate></item><item><title>Re: Rewrite domain.com to www.domain.com using htaccess in Apache</title><link>http://www.tech-recipes.com/rx/296/rewrite-domaincom-to-wwwdomaincom-using-htaccess-in-apache/#comment-177579406</link><description>&lt;p&gt;Not quite there..&lt;br&gt;needs to a match true condition -&amp;gt; "!":&lt;/p&gt;&lt;p&gt;RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ [NC]&lt;/p&gt;&lt;p&gt;(added '!" and [NC])&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bmatthewshea</dc:creator><pubDate>Sun, 03 Apr 2011 20:29:47 -0000</pubDate></item><item><title>Re: Rewrite domain.com to www.domain.com using htaccess in Apache</title><link>http://www.tech-recipes.com/rx/296/rewrite-domaincom-to-wwwdomaincom-using-htaccess-in-apache/#comment-48124789</link><description>&lt;p&gt;If the idea is to redirect all non-canonical forms of the hostname to exactly &lt;a href="http://www.example.com/" rel="nofollow noopener" target="_blank" title="www.example.com/"&gt;www.example.com/&lt;/a&gt; beware that your standard code does not redirect www requests with an appended port number &lt;a href="http://www.example.com" rel="nofollow noopener" target="_blank" title="www.example.com"&gt;www.example.com&lt;/a&gt;:80/ and does not redirect www requests with an appended period &lt;a href="http://www.example.com" rel="nofollow noopener" target="_blank" title="www.example.com"&gt;www.example.com&lt;/a&gt;./ either. This leaves a site open to Duplicate Content indexing if malicious links are pointed at non-canonical URLs.&lt;/p&gt;&lt;p&gt;The fix is very simple, a minor edit to the originally suggested code:&lt;/p&gt;&lt;p&gt;Options +FollowSymLinks&lt;br&gt;RewriteEngine on&lt;br&gt;RewriteCond %{HTTP_HOST} ^(www\.example\.com)?$&lt;br&gt;RewriteRule (.*) &lt;a href="http://www.example.com/$1" rel="nofollow noopener" target="_blank" title="http://www.example.com/$1"&gt;http://www.example.com/$1&lt;/a&gt; [R=301,L]&lt;/p&gt;&lt;p&gt;Additionally, the ( ) ? syntax ensures that HTTP/1.0 requests - which have a blank HOST header - do not cause an infinite redirection loop.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">g1smd</dc:creator><pubDate>Mon, 03 May 2010 02:45:49 -0000</pubDate></item><item><title>Re: Rewrite domain.com to www.domain.com using htaccess in Apache</title><link>http://www.tech-recipes.com/rx/296/rewrite-domaincom-to-wwwdomaincom-using-htaccess-in-apache/#comment-36406379</link><description>&lt;p&gt;YOU are just silly and redundant.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Negro123</dc:creator><pubDate>Thu, 25 Feb 2010 03:08:21 -0000</pubDate></item><item><title>Re: Rewrite domain.com to www.domain.com using htaccess in Apache</title><link>http://www.tech-recipes.com/rx/296/rewrite-domaincom-to-wwwdomaincom-using-htaccess-in-apache/#comment-6236961</link><description>&lt;p&gt;Why? WWW (World Wide Web) was incorporated to force browsers to use the HTTP protocol when the Internet was new. Now all modern browsers default to HTTP by default, so what is the point of WWW? Mail servers certainly don't require you to use 'address@mail.yourdomain.com', so why should the web be any different?&lt;/p&gt;&lt;p&gt;No, sites should be redirecting the 'www' subdomain to the TLD without 'www'. See &lt;a href="http://no-www.org" rel="nofollow noopener" target="_blank" title="http://no-www.org"&gt;http://no-www.org&lt;/a&gt; for more info. Class B compliance should be the goal of every site owner. Forcing WWW is just silly and redundant.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Aaron Toponce</dc:creator><pubDate>Fri, 13 Feb 2009 07:08:25 -0000</pubDate></item><item><title>Re: Rewrite domain.com to www.domain.com using htaccess in Apache</title><link>http://www.tech-recipes.com/rx/296/rewrite-domaincom-to-wwwdomaincom-using-htaccess-in-apache/#comment-4874902</link><description>&lt;p&gt;Thanks i will try&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">escorts</dc:creator><pubDate>Sat, 03 Jan 2009 23:50:21 -0000</pubDate></item></channel></rss>