<?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: Redirecting subdomains to directories in apache.</title>
	<atom:link href="http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/</link>
	<description>the personal blog of Stuart Colville covering modern web development techniques and best practices</description>
	<lastBuildDate>Wed, 10 Mar 2010 11:00:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Adam Klein</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-65512</link>
		<dc:creator>Adam Klein</dc:creator>
		<pubDate>Wed, 03 Feb 2010 08:05:08 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-65512</guid>
		<description>Glad to find this post.

I&#039;d like to redirect advisors.pacificadvisors.com to http://thedock.pacificadvisors.com/advisors/training-education-schedule 
using vhost.conf as I tried .htaccess and that didn&#039;t work.  Currently vhost.conf file has:
 
serverAlias *.domain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.* [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com
RewriteCond /var/www/vhosts/domain.com/httpdocs/%1 -d

would appreciate some help
RewriteRule ^(.*) /%1/$1 [L]</description>
		<content:encoded><![CDATA[<p>Glad to find this post.</p>
<p>I&#8217;d like to redirect advisors.pacificadvisors.com to <a href="http://thedock.pacificadvisors.com/advisors/training-education-schedule" rel="nofollow">http://thedock.pacificadvisors.com/advisors/training-education-schedule</a><br />
using vhost.conf as I tried .htaccess and that didn&#8217;t work.  Currently vhost.conf file has:</p>
<p>serverAlias *.domain.com<br />
RewriteEngine on<br />
RewriteCond %{HTTP_HOST} !^www.* [NC]<br />
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com<br />
RewriteCond /var/www/vhosts/domain.com/httpdocs/%1 -d</p>
<p>would appreciate some help<br />
RewriteRule ^(.*) /%1/$1 [L]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emre</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-65509</link>
		<dc:creator>emre</dc:creator>
		<pubDate>Sat, 30 Jan 2010 07:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-65509</guid>
		<description>hey there,

i am looking for a way to internally redirect http://xxx.domain.com/yyy requests to file.php?item1=$xxx&amp;item2=yyy on apache. 

namely i need a subdomain and an ordinary redirect at the same time.

i can do http://xxx.domain.com &gt; somefile.php?item=xxx and http://www.domain.com/yyy redirects seperately. now i need to combine them.

i tried this:
&lt;code&gt;RewriteCond %{HTTP_HOST} !^www\.ceviritercume\.org$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.ceviritercume\.org/([A-Za-z0-9_)(:!-&#039;,]+)/?$ [NC]
RewriteRule ^$ /dil_konu.php?dil=%2&amp;konu=$1 [L] &lt;/code&gt;

but no success...

any ideas how it can be achieved?</description>
		<content:encoded><![CDATA[<p>hey there,</p>
<p>i am looking for a way to internally redirect <a href="http://xxx.domain.com/yyy" rel="nofollow">http://xxx.domain.com/yyy</a> requests to file.php?item1=$xxx&amp;item2=yyy on apache. </p>
<p>namely i need a subdomain and an ordinary redirect at the same time.</p>
<p>i can do <a href="http://xxx.domain.com" rel="nofollow">http://xxx.domain.com</a> &gt; somefile.php?item=xxx and <a href="http://www.domain.com/yyy" rel="nofollow">http://www.domain.com/yyy</a> redirects seperately. now i need to combine them.</p>
<p>i tried this:<br />
<code>RewriteCond %{HTTP_HOST} !^www\.ceviritercume\.org$ [NC]<br />
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.ceviritercume\.org/([A-Za-z0-9_)(:!-',]+)/?$ [NC]<br />
RewriteRule ^$ /dil_konu.php?dil=%2&amp;konu=$1 [L] </code></p>
<p>but no success&#8230;</p>
<p>any ideas how it can be achieved?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruno</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-65444</link>
		<dc:creator>Bruno</dc:creator>
		<pubDate>Thu, 03 Dec 2009 10:45:01 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-65444</guid>
		<description>Hello...
perhaps i didnt explain the way it should :)
i want that webmail.ingrupo.com goes to webmail ( HORDE ) the default server webmail reader and not a directory inside ingrupo.com.
if i remove that line it will search for that dir inside ingrupo.com/sites right? but i want that when users type webmail.ingrupo.com they can access the email software from that server.

Regards,
B</description>
		<content:encoded><![CDATA[<p>Hello&#8230;<br />
perhaps i didnt explain the way it should <img src='http://muffinresearch.co.uk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
i want that webmail.ingrupo.com goes to webmail ( HORDE ) the default server webmail reader and not a directory inside ingrupo.com.<br />
if i remove that line it will search for that dir inside ingrupo.com/sites right? but i want that when users type webmail.ingrupo.com they can access the email software from that server.</p>
<p>Regards,<br />
B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Colville</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-65443</link>
		<dc:creator>Stuart Colville</dc:creator>
		<pubDate>Thu, 03 Dec 2009 09:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-65443</guid>
		<description>@Bruno: The second RewriteCond directive is saying ensure the host &lt;em&gt;does not&lt;/em&gt; start with webmail.

As a result any requests to webmail.ingrupo.com will not be processed by the rest of the re-write rule.</description>
		<content:encoded><![CDATA[<p>@Bruno: The second RewriteCond directive is saying ensure the host <em>does not</em> start with webmail.</p>
<p>As a result any requests to webmail.ingrupo.com will not be processed by the rest of the re-write rule.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruno</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-65441</link>
		<dc:creator>Bruno</dc:creator>
		<pubDate>Wed, 02 Dec 2009 19:01:22 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-65441</guid>
		<description>hello..
i&#039;ve tried 

&lt;pre&gt;&lt;code&gt;ServerAlias *.ingrupo.com
RewriteEngine on

RewriteCond %{HTTP_HOST} !^www.* [NC]
RewriteCond %{HTTP_HOST} !^webmail.* [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.ingrupo\.com
RewriteCond /var/www/vhosts/ingrupo.com/httpdocs/sites/%1 -d
RewriteRule ^(.*) /sites/%1/$1 [L]&lt;/code&gt;&lt;/pre&gt;


and it redirects ok.. but webmail doesnt work.. it redirects to ingrupo.com and not for the real webmail.ingrupo.com
any ideas?!

Regards,
B</description>
		<content:encoded><![CDATA[<p>hello..<br />
i&#8217;ve tried </p>
<pre><code>ServerAlias *.ingrupo.com
RewriteEngine on

RewriteCond %{HTTP_HOST} !^www.* [NC]
RewriteCond %{HTTP_HOST} !^webmail.* [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.ingrupo\.com
RewriteCond /var/www/vhosts/ingrupo.com/httpdocs/sites/%1 -d
RewriteRule ^(.*) /sites/%1/$1 [L]</code></pre>
<p>and it redirects ok.. but webmail doesnt work.. it redirects to ingrupo.com and not for the real webmail.ingrupo.com<br />
any ideas?!</p>
<p>Regards,<br />
B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vijay</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-65397</link>
		<dc:creator>vijay</dc:creator>
		<pubDate>Mon, 09 Nov 2009 06:42:22 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-65397</guid>
		<description>I have One issue, please help me. My issue is I have url http://subdomain.mydomain.com and want to redirect them http://mydomin.com/folder1/index.php?user=subdomain. but I dont want to change URL in addressbar so in addressbar the url should be http://subdomain.mydomain.com. What i have to do? My .htaccess code is:

&lt;pre&gt;&lt;code&gt;=================================
#RewriteCond %{HTTP_HOST} !^www\.mydomain.com [NC]
#RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain.com [NC]
#RewriteRule ^(.*)$ http://mydomain.com/folder1/index.php?user=%1 [L]
=================================&lt;/code&gt;&lt;/pre&gt;

It redirect correctly, But Unfortunitly, it affect addressbar, so it&#039;s useless for me. Please help me. What I have to do? Thanks in advance.</description>
		<content:encoded><![CDATA[<p>I have One issue, please help me. My issue is I have url <a href="http://subdomain.mydomain.com" rel="nofollow">http://subdomain.mydomain.com</a> and want to redirect them <a href="http://mydomin.com/folder1/index.php?user=subdomain" rel="nofollow">http://mydomin.com/folder1/index.php?user=subdomain</a>. but I dont want to change URL in addressbar so in addressbar the url should be <a href="http://subdomain.mydomain.com" rel="nofollow">http://subdomain.mydomain.com</a>. What i have to do? My .htaccess code is:</p>
<pre><code>=================================
#RewriteCond %{HTTP_HOST} !^www\.mydomain.com [NC]
#RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain.com [NC]
#RewriteRule ^(.*)$ <a href="http://mydomain.com/folder1/index.php?user=%1" rel="nofollow">http://mydomain.com/folder1/index.php?user=%1</a> [L]
=================================</code></pre>
<p>It redirect correctly, But Unfortunitly, it affect addressbar, so it&#8217;s useless for me. Please help me. What I have to do? Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pieter</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-65363</link>
		<dc:creator>Pieter</dc:creator>
		<pubDate>Thu, 22 Oct 2009 13:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-65363</guid>
		<description>Thanks! Works perfect!</description>
		<content:encoded><![CDATA[<p>Thanks! Works perfect!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: meegan</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-65014</link>
		<dc:creator>meegan</dc:creator>
		<pubDate>Tue, 07 Apr 2009 20:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-65014</guid>
		<description>So random that I was looking to figure how to do this and he used my name! Too funny. Good article and especially awesome use of my name : )</description>
		<content:encoded><![CDATA[<p>So random that I was looking to figure how to do this and he used my name! Too funny. Good article and especially awesome use of my name : )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-64478</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 13 Jul 2008 06:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-64478</guid>
		<description>Does anybody know how to set it up on a server running CPanel? Tried with virtual hosts method and my apache process is 190Mb in size...
&lt;a href=&quot;http://www.filesland.com&quot; rel=&quot;nofollow&quot;&gt;Filesland&lt;a&gt;</description>
		<content:encoded><![CDATA[<p>Does anybody know how to set it up on a server running CPanel? Tried with virtual hosts method and my apache process is 190Mb in size&#8230;<br />
<a href="http://www.filesland.com" rel="nofollow">Filesland</a><a></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/comment-page-1/#comment-64245</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Wed, 16 Apr 2008 03:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-64245</guid>
		<description>How would one do this with say WAMP Server?</description>
		<content:encoded><![CDATA[<p>How would one do this with say WAMP Server?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
