<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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>Comments on: Domain redirect wizardry with .htaccess rules</title>
	<atom:link href="http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 30 Sep 2011 03:10:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Andrew Brown</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-873</link>
		<dc:creator>Andrew Brown</dc:creator>
		<pubDate>Wed, 16 Sep 2009 19:24:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-873</guid>
		<description>Dear Guilherme

I am terribly sorry to pester you further but I have been trying and trying all day and things just don’t go.

Currently the domains browns.co.uk, brownsbox.com and mainsdata.com all point to 217.46.224.255.

What I would like to happen is that when the client enters either &lt;a href=&quot;http://www.browns.co.uk/&quot; rel=&quot;nofollow&quot;&gt; or &lt;a href=&quot;http://www.brownsbox.com/&quot; rel=&quot;nofollow&quot;&gt; that they get /index.php but when they put in &lt;a href=&quot;http://mainsdata.com/&quot; rel=&quot;nofollow&quot;&gt;, I would like them either to get /mainsdata.php or /mainsdata/index.php. Finally, I am constrained to using just one server of either a physical variety or a virtual variety.

Many thanks for your help.</description>
		<content:encoded><![CDATA[<p>Dear Guilherme</p>
<p>I am terribly sorry to pester you further but I have been trying and trying all day and things just don’t go.</p>
<p>Currently the domains browns.co.uk, brownsbox.com and mainsdata.com all point to 217.46.224.255.</p>
<p>What I would like to happen is that when the client enters either <a href="http://www.browns.co.uk/" rel="nofollow"> or </a><a href="http://www.brownsbox.com/" rel="nofollow"> that they get /index.php but when they put in </a><a href="http://mainsdata.com/" rel="nofollow">, I would like them either to get /mainsdata.php or /mainsdata/index.php. Finally, I am constrained to using just one server of either a physical variety or a virtual variety.</p>
<p>Many thanks for your help.</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme Zühlke O'Connor</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-872</link>
		<dc:creator>Guilherme Zühlke O'Connor</dc:creator>
		<pubDate>Wed, 16 Sep 2009 08:27:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-872</guid>
		<description>@Andrew Brown - Andy, the IP is no problem at all. That will be taken care of by DNS. As long as you have both domains set up correctly (which is assumed for this tutorial) all the rest will work.

Straing to your question, I understand you want requests to www.new-domain.com to be redirected to www.old-domain.com/new-domain, you do that by placing this rule into newdomain.com.

&lt;code&gt;
RewriteEngine on
RewriteRule ^(.∗)$ http://www.old-domain.com/new-domain/$1 [R=301,L]
&lt;/code&gt;

A request to www.new-domain.com/foobar will now be redirected to www.old-domain.com/new-domain/foobar</description>
		<content:encoded><![CDATA[<p>@Andrew Brown &#8211; Andy, the IP is no problem at all. That will be taken care of by DNS. As long as you have both domains set up correctly (which is assumed for this tutorial) all the rest will work.</p>
<p>Straing to your question, I understand you want requests to <a href="http://www.new-domain.com" rel="nofollow">http://www.new-domain.com</a> to be redirected to <a href="http://www.old-domain.com/new-domain" rel="nofollow">http://www.old-domain.com/new-domain</a>, you do that by placing this rule into newdomain.com.</p>
<p><code><br />
RewriteEngine on<br />
RewriteRule ^(.∗)$ <a href="http://www.old-domain.com/new-domain/$1" rel="nofollow">http://www.old-domain.com/new-domain/$1</a> [R=301,L]<br />
</code></p>
<p>A request to <a href="http://www.new-domain.com/foobar" rel="nofollow">http://www.new-domain.com/foobar</a> will now be redirected to <a href="http://www.old-domain.com/new-domain/foobar" rel="nofollow">http://www.old-domain.com/new-domain/foobar</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Brown</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-871</link>
		<dc:creator>Andrew Brown</dc:creator>
		<pubDate>Tue, 15 Sep 2009 19:30:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-871</guid>
		<description>Dear Guilherme

Like everyone else, I think you&#039;ve very successfully broken down a mystical whole into its understandable parts and deftly strung the parts together to form a coherent and engaging narrative, just like a string of beads, well done!

Now onto a problem.  I would like www.new-domain.com to point to www.old-domain.com/new-domain/, the only problem is though that www.new-domain.com and www.old-domain.com share the same IP address and the same host (naturally).  Any ideas?

Many thanks in advance.</description>
		<content:encoded><![CDATA[<p>Dear Guilherme</p>
<p>Like everyone else, I think you&#8217;ve very successfully broken down a mystical whole into its understandable parts and deftly strung the parts together to form a coherent and engaging narrative, just like a string of beads, well done!</p>
<p>Now onto a problem.  I would like <a href="http://www.new-domain.com" rel="nofollow">http://www.new-domain.com</a> to point to <a href="http://www.old-domain.com/new-domain/" rel="nofollow">http://www.old-domain.com/new-domain/</a>, the only problem is though that <a href="http://www.new-domain.com" rel="nofollow">http://www.new-domain.com</a> and <a href="http://www.old-domain.com" rel="nofollow">http://www.old-domain.com</a> share the same IP address and the same host (naturally).  Any ideas?</p>
<p>Many thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme Zühlke O'Connor</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-870</link>
		<dc:creator>Guilherme Zühlke O'Connor</dc:creator>
		<pubDate>Wed, 10 Jun 2009 08:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-870</guid>
		<description>In this context, yes, but actually there is some terminology mistake on my side, there are different techniques with similar names, cloaking is most commonly used for a technique to fool search engines.

Anyway, terminology mistakes apart, I think you can do just well by simple make a redirect from domain A to B and let the domain change. If you do it properly, in a few days or weeks at most all your search engine traffic will be linking directly to the new domain.</description>
		<content:encoded><![CDATA[<p>In this context, yes, but actually there is some terminology mistake on my side, there are different techniques with similar names, cloaking is most commonly used for a technique to fool search engines.</p>
<p>Anyway, terminology mistakes apart, I think you can do just well by simple make a redirect from domain A to B and let the domain change. If you do it properly, in a few days or weeks at most all your search engine traffic will be linking directly to the new domain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rizwan</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-869</link>
		<dc:creator>Rizwan</dc:creator>
		<pubDate>Tue, 09 Jun 2009 16:52:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-869</guid>
		<description>Is cloaking the same as Frame Forwarding? 

The reason I want to do that is because we have a listing directory installed on one server with Domain A but we prefer Domain B and want to use that instead.</description>
		<content:encoded><![CDATA[<p>Is cloaking the same as Frame Forwarding? </p>
<p>The reason I want to do that is because we have a listing directory installed on one server with Domain A but we prefer Domain B and want to use that instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme Zühlke O'Connor</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-868</link>
		<dc:creator>Guilherme Zühlke O'Connor</dc:creator>
		<pubDate>Tue, 09 Jun 2009 16:34:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-868</guid>
		<description>@Rizwan - Well, you can do that combining different techniques. Redirects will take you to another page, period. But you can, for instance, use a frame to include the page form the other domain, which is known as cloaking.

Now, why would you want to do that?</description>
		<content:encoded><![CDATA[<p>@Rizwan &#8211; Well, you can do that combining different techniques. Redirects will take you to another page, period. But you can, for instance, use a frame to include the page form the other domain, which is known as cloaking.</p>
<p>Now, why would you want to do that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rizwan</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-867</link>
		<dc:creator>Rizwan</dc:creator>
		<pubDate>Tue, 09 Jun 2009 13:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-867</guid>
		<description>Hi Guilherme, 
I want to redirect Domain A to Domain B but I want the url to stay Domain A. So after the redirect users should still see www.DomainA/page.php and any link they click on they still see www.DomainA/contactus.php instead of reverting back to the old domain. 

Does that make sense?</description>
		<content:encoded><![CDATA[<p>Hi Guilherme,<br />
I want to redirect Domain A to Domain B but I want the url to stay Domain A. So after the redirect users should still see <a href="http://www.DomainA/page.php" rel="nofollow">http://www.DomainA/page.php</a> and any link they click on they still see <a href="http://www.DomainA/contactus.php" rel="nofollow">http://www.DomainA/contactus.php</a> instead of reverting back to the old domain. </p>
<p>Does that make sense?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeet</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-866</link>
		<dc:creator>Jeet</dc:creator>
		<pubDate>Sat, 21 Mar 2009 07:42:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-866</guid>
		<description>&lt;p&gt;Most of the time people change name of a category, remove dates from their URL or simply use a &#039;pretty URL&#039; instead of an ugly URL with lots of parameters.&lt;/p&gt;

&lt;p&gt;Something like this is very popular:&lt;/p&gt;

&lt;p&gt;RewriteRule ^path.php?par1=(.&lt;em&gt;)&amp;par2=(.&lt;/em&gt;)$ http://www.domain.tld/path/pretty-url-$1-and-$2 [R=301,L]&lt;/p&gt;

&lt;p&gt;I have seen this in a lot of websites where &#039;one&#039; php file is used to show details of many resources identified by an id or a slug.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Most of the time people change name of a category, remove dates from their URL or simply use a &#8216;pretty URL&#8217; instead of an ugly URL with lots of parameters.</p>
<p>Something like this is very popular:</p>
<p>RewriteRule ^path.php?par1=(.<em>)&amp;par2=(.</em>)$ <a href="http://www.domain.tld/path/pretty-url-$1-and-$2" rel="nofollow">http://www.domain.tld/path/pretty-url-$1-and-$2</a> [R=301,L]</p>
<p>I have seen this in a lot of websites where &#8216;one&#8217; php file is used to show details of many resources identified by an id or a slug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme Zühlke O'Connor</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-865</link>
		<dc:creator>Guilherme Zühlke O'Connor</dc:creator>
		<pubDate>Thu, 19 Feb 2009 17:56:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-865</guid>
		<description>&lt;p&gt;@Michael, @Damien - Thanks, I&#039;m glad it&#039;s useful.&lt;/p&gt;

&lt;p&gt;@DJPumpkin - &lt;blockquote&gt;&lt;p&gt;from
http://www.oldomain.com/path/page
to
http://www.newdomain.com/path/to/page&lt;/p&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;If your directory is going to be static across the site, then it&#039;s as easy as doing&lt;/p&gt;

&lt;p&gt;RewriteRule ^path/(.*)$ http://www.newdomain.com/path/to/$1 [R=301,L]&lt;/p&gt;

&lt;p&gt;Now, if &quot;path&quot; and &quot;to&quot; are to change according to context (e.g., dates or categories) then it may become much more complex.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Michael, @Damien &#8211; Thanks, I&#8217;m glad it&#8217;s useful.</p>
<p>@DJPumpkin &#8211;<br />
<blockquote>
<p>from<br />
<a href="http://www.oldomain.com/path/page" rel="nofollow">http://www.oldomain.com/path/page</a><br />
to<br />
<a href="http://www.newdomain.com/path/to/page" rel="nofollow">http://www.newdomain.com/path/to/page</a></p>
</blockquote>
<p>If your directory is going to be static across the site, then it&#8217;s as easy as doing</p>
<p>RewriteRule ^path/(.*)$ <a href="http://www.newdomain.com/path/to/$1" rel="nofollow">http://www.newdomain.com/path/to/$1</a> [R=301,L]</p>
<p>Now, if &#8220;path&#8221; and &#8220;to&#8221; are to change according to context (e.g., dates or categories) then it may become much more complex.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DJPumpkin</title>
		<link>http://www.z-oc.com/blog/2009/01/htaccess-redirect-wizardry/#comment-864</link>
		<dc:creator>DJPumpkin</dc:creator>
		<pubDate>Tue, 17 Feb 2009 13:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.z-oc.com/blog/2009/01/untitled/#comment-864</guid>
		<description>&lt;p&gt;Hi,  Great post.&lt;/p&gt;

&lt;p&gt;What if you are moving to a new site with a different site structure?  For instance:&lt;/p&gt;

&lt;p&gt;from
http://www.oldomain.com/path/page
to
http://www.newdomain.com/path/to/page&lt;/p&gt;

&lt;p&gt;What redirect command is needed to take into account the new subdirectory?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,  Great post.</p>
<p>What if you are moving to a new site with a different site structure?  For instance:</p>
<p>from<br />
<a href="http://www.oldomain.com/path/page" rel="nofollow">http://www.oldomain.com/path/page</a><br />
to<br />
<a href="http://www.newdomain.com/path/to/page" rel="nofollow">http://www.newdomain.com/path/to/page</a></p>
<p>What redirect command is needed to take into account the new subdirectory?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

