<?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"
	>
<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>
	<pubDate>Sun, 05 Jul 2009 01:59:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: meegan</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#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-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="http://www.filesland.com" rel="nofollow"&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-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>
	<item>
		<title>By: Charles</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-40734</link>
		<dc:creator>Charles</dc:creator>
		<pubDate>Fri, 01 Jun 2007 04:26:50 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-40734</guid>
		<description>I have a mod rewrite problem that I cannot find a solution to. So, if anyone is interested in solving this for a high school teacher, here it is.

I have the following .htaccess file in my root directory for http://www.myedusite.com

RewriteCond %{HTTP_HOST} ^([^.]+)\.k12\.myedusite\.com$ [NC]
RewriteCond %{HTTP_HOST} !^www [NC]
RewriteCond %{REQUEST_URI) !^%1/ [NC]
RewriteRule ^(.*)$ /home/httpd/vhosts/myedusite.com/httpdocs/webumake/teachers/%1/$1

This rewrite creates http://username.k12.myedusite.com, so my website of http://chills.k12.myedusite.com will read exactly the same in the url address. I have a subdomain program installed in the web site builder that does this for any username account.

The question I have is how do I change the rewrite so that anyone who types in http://chills.k12.myedusite.com will be redirected to https://chills.k12.myedusite.com? 

Sincerely,
Charles</description>
		<content:encoded><![CDATA[<p>I have a mod rewrite problem that I cannot find a solution to. So, if anyone is interested in solving this for a high school teacher, here it is.</p>
<p>I have the following .htaccess file in my root directory for <a href="http://www.myedusite.com" rel="nofollow">http://www.myedusite.com</a></p>
<p>RewriteCond %{HTTP_HOST} ^([^.]+)\.k12\.myedusite\.com$ [NC]<br />
RewriteCond %{HTTP_HOST} !^www [NC]<br />
RewriteCond %{REQUEST_URI) !^%1/ [NC]<br />
RewriteRule ^(.*)$ /home/httpd/vhosts/myedusite.com/httpdocs/webumake/teachers/%1/$1</p>
<p>This rewrite creates <a href="http://username.k12.myedusite.com" rel="nofollow">http://username.k12.myedusite.com</a>, so my website of <a href="http://chills.k12.myedusite.com" rel="nofollow">http://chills.k12.myedusite.com</a> will read exactly the same in the url address. I have a subdomain program installed in the web site builder that does this for any username account.</p>
<p>The question I have is how do I change the rewrite so that anyone who types in <a href="http://chills.k12.myedusite.com" rel="nofollow">http://chills.k12.myedusite.com</a> will be redirected to <a href="https://chills.k12.myedusite.com?" rel="nofollow">https://chills.k12.myedusite.com?</a> </p>
<p>Sincerely,<br />
Charles</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-29904</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 06 Mar 2007 14:23:32 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-29904</guid>
		<description>Help..! I tried setting up the above method, but through Plesk dns zones instead of my registrar. Well plesk sucks in my personal feeling when it comes to managing DNS and subdomains.

MY main web site is fine but my subdomains are hit and miss. How do you setup your zone files through your registrar and point to plesk without conflicts? I can manage my registrar no problems but when I activate them there is nothing. Do you change or turn off plesk dns?</description>
		<content:encoded><![CDATA[<p>Help..! I tried setting up the above method, but through Plesk dns zones instead of my registrar. Well plesk sucks in my personal feeling when it comes to managing DNS and subdomains.</p>
<p>MY main web site is fine but my subdomains are hit and miss. How do you setup your zone files through your registrar and point to plesk without conflicts? I can manage my registrar no problems but when I activate them there is nothing. Do you change or turn off plesk dns?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joey B</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-27800</link>
		<dc:creator>Joey B</dc:creator>
		<pubDate>Fri, 23 Feb 2007 15:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-27800</guid>
		<description>This is exactly what I have been looking for. My only question is that I don't have a domain assigned to my server (yet) and I need to know if there is a way to make the rewrite the computer with the name it was called by instead of a domain name. So no matter what the server is called by (127.0.0.1,localhost,192.168..,Computer name, domain name) it returns that name.</description>
		<content:encoded><![CDATA[<p>This is exactly what I have been looking for. My only question is that I don&#8217;t have a domain assigned to my server (yet) and I need to know if there is a way to make the rewrite the computer with the name it was called by instead of a domain name. So no matter what the server is called by (127.0.0.1,localhost,192.168..,Computer name, domain name) it returns that name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gijsbert</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-25029</link>
		<dc:creator>Gijsbert</dc:creator>
		<pubDate>Tue, 06 Feb 2007 20:17:16 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-25029</guid>
		<description>First of all great explanation. I'm trying to rewrite a cname.domain.com to domain.com/dir/cname.php

With the explanation above I can rewrite:

cname.domain.com --&#62; domain.com/dir/cname/

But I need cname as being a php-file, so it should be:

cname.domain.com --&#62; domain.com/dir/cname.php

Any ideas?</description>
		<content:encoded><![CDATA[<p>First of all great explanation. I&#8217;m trying to rewrite a cname.domain.com to domain.com/dir/cname.php</p>
<p>With the explanation above I can rewrite:</p>
<p>cname.domain.com &#8211;&gt; domain.com/dir/cname/</p>
<p>But I need cname as being a php-file, so it should be:</p>
<p>cname.domain.com &#8211;&gt; domain.com/dir/cname.php</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bdogg64</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-13988</link>
		<dc:creator>bdogg64</dc:creator>
		<pubDate>Tue, 31 Oct 2006 21:59:39 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-13988</guid>
		<description>Thanks a bunch!</description>
		<content:encoded><![CDATA[<p>Thanks a bunch!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Callender</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-10402</link>
		<dc:creator>Jim Callender</dc:creator>
		<pubDate>Fri, 22 Sep 2006 08:05:11 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-10402</guid>
		<description>This is the way to do it on apache. But why not save less code and use .htaccess?

All you have to do is in file name ".htaccess" put in file:

DirectoryIndex about.htm

then your website address: www.website.com/about/

will go to: www.website.com/about/about.htm

without this file you will either get a 404 or view the parent directory.

Hope this helps those who dont dabble in apache :)</description>
		<content:encoded><![CDATA[<p>This is the way to do it on apache. But why not save less code and use .htaccess?</p>
<p>All you have to do is in file name &#8220;.htaccess&#8221; put in file:</p>
<p>DirectoryIndex about.htm</p>
<p>then your website address: <a href="http://www.website.com/about/" rel="nofollow">http://www.website.com/about/</a></p>
<p>will go to: <a href="http://www.website.com/about/about.htm" rel="nofollow">http://www.website.com/about/about.htm</a></p>
<p>without this file you will either get a 404 or view the parent directory.</p>
<p>Hope this helps those who dont dabble in apache <img src='http://muffinresearch.co.uk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oosman</title>
		<link>http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-8897</link>
		<dc:creator>oosman</dc:creator>
		<pubDate>Mon, 04 Sep 2006 16:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/#comment-8897</guid>
		<description>Thank you for these instructions. 

You can also do this using virutal hosts, but I did not know about this method.

To do it using virtual host method add new virtual host in http.conf file:

pico -w /etc/httpd/conf/httpd.conf

then add this block:


ServerName bugzilla.demha.com
ServerAlias bugzilla.demha.com
ServerPath /bugzilla
DocumentRoot /var/www/html/bugzilla
DirectoryIndex index.shtml index.html index.php index.htm


However this does not work for secure apache (https) - that is why your method is helpful. However I the pages now served from the sub-directory are no longer encyrpted. I am trying to figure out how to encrypt the sub-domain pages as well.</description>
		<content:encoded><![CDATA[<p>Thank you for these instructions. </p>
<p>You can also do this using virutal hosts, but I did not know about this method.</p>
<p>To do it using virtual host method add new virtual host in http.conf file:</p>
<p>pico -w /etc/httpd/conf/httpd.conf</p>
<p>then add this block:</p>
<p>ServerName bugzilla.demha.com<br />
ServerAlias bugzilla.demha.com<br />
ServerPath /bugzilla<br />
DocumentRoot /var/www/html/bugzilla<br />
DirectoryIndex index.shtml index.html index.php index.htm</p>
<p>However this does not work for secure apache (https) - that is why your method is helpful. However I the pages now served from the sub-directory are no longer encyrpted. I am trying to figure out how to encrypt the sub-domain pages as well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
