<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.imanpage.com"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Iman&#039;s Page - Apache</title>
 <link>http://www.imanpage.com/taxonomy/term/42/all</link>
 <description></description>
 <language>en</language>
<item>
 <title>URL rewriting and add www to .htaccess for hosting multiple domain or multi sites</title>
 <link>http://www.imanpage.com/code/url-rewriting-and-add-www-htaccess-hosting-multiple-domain-or-multi-sites</link>
 <description>Adding the www to URL in .htaccess for hosting multiple domain or multisites and handle www issue for canonical URLs. 

&lt;br /&gt;

&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;##Adding the www&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RewriteCond &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;HTTP_HOST&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;!&lt;/span&gt;^www\. &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;NC&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RewriteCond &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;HTTP_HOST&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt; ^&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;$ &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;NC&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RewriteRule ^&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;$ &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.%1/$1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;L,&lt;span style=&quot;color: #007800;&quot;&gt;R&lt;/span&gt;=&lt;span style=&quot;color: #000000;&quot;&gt;301&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;

&lt;br /&gt;

The other way around you can &lt;a href=&quot;http://www.imanpage.com/code/remove-www-and-rewrite-url-multi-sites-or-subdomains-htaccess&quot; &gt;removing the www&lt;/a&gt; from URL.

&lt;br /&gt;
&lt;br /&gt;</description>
 <comments>http://www.imanpage.com/code/url-rewriting-and-add-www-htaccess-hosting-multiple-domain-or-multi-sites#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/htaccess">.htaccess</category>
 <category domain="http://www.imanpage.com/code/apache">Apache</category>
 <category domain="http://www.imanpage.com/code/bash">Bash</category>
 <category domain="http://www.imanpage.com/code/linux">Linux</category>
 <pubDate>Mon, 08 Feb 2010 13:43:33 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">30 at http://www.imanpage.com</guid>
</item>
<item>
 <title>Remove www and rewrite URL for multi-sites or subdomains in .htaccess</title>
 <link>http://www.imanpage.com/code/remove-www-and-rewrite-url-multi-sites-or-subdomains-htaccess</link>
 <description>If you are running a Multisites or Subdomains sites this .htaccess RewriteRule code might come in handy specially for purpose of SEO. You can clean up your URL from http://www.yourdomain.com to http://yourdomain.com and remove the “www” with 301 redirect to non-www.

&lt;br /&gt;

&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;RewriteEngine on&lt;br /&gt;
RewriteCond &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;HTTP_HOST&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt; ^www\.&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;.+&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;$ &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;NC&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;
RewriteRule ^&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;$ http:&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;//%&lt;/span&gt;1&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;$1 &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;L,&lt;span style=&quot;color: #007800;&quot;&gt;R&lt;/span&gt;=&lt;span style=&quot;color: #000000;&quot;&gt;301&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;

&lt;br /&gt;

If you want to add the &lt;a href=&quot;http://www.imanpage.com/code/url-rewriting-and-add-www-htaccess-hosting-multiple-domain-or-multi-sites&quot; &gt;www to URLs&lt;/a&gt; check this out. 

&lt;br /&gt;
&lt;br /&gt;</description>
 <comments>http://www.imanpage.com/code/remove-www-and-rewrite-url-multi-sites-or-subdomains-htaccess#comments</comments>
 <category domain="http://www.imanpage.com/code">Code</category>
 <category domain="http://www.imanpage.com/code/htaccess">.htaccess</category>
 <category domain="http://www.imanpage.com/code/apache">Apache</category>
 <category domain="http://www.imanpage.com/code/linux">Linux</category>
 <pubDate>Fri, 05 Feb 2010 16:29:03 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">29 at http://www.imanpage.com</guid>
</item>
</channel>
</rss>

