<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: How can I setup dynamic sub domains?</title>
	<link>http://ask.metafilter.com/43805/How-can-I-setup-dynamic-sub-domains/</link>
	<description>Comments on Ask MetaFilter post How can I setup dynamic sub domains?</description>
	<pubDate>Mon, 07 Aug 2006 01:05:02 -0800</pubDate>
	<lastBuildDate>Mon, 07 Aug 2006 01:05:02 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: How can I setup dynamic sub domains?</title>
		<link>http://ask.metafilter.com/43805/How-can-I-setup-dynamic-sub-domains</link>	
		<description>Sub-sub domains with mod_rewrite - can it be done? &lt;br /&gt;&lt;br /&gt; I&apos;m setting up a bunch of domains that follow a consistent naming structure (category/subcategory/file.html).  I&apos;ve setup dynamic wildcards on these domains, and I know how to handle pathing dynamically via PHP, but I&apos;m really interested in setting up a solution like this:&lt;br&gt;
&lt;br&gt;
user enters http://subcategory.category.domain.com/index.html, which rewrites to domain.com/category/sucategory/index.html, without changing the browser path.&lt;br&gt;
&lt;br&gt;
As an added level of complexity, i&apos;d like to be able to use drupal on some of the subpaths, so I need to be able to honor their htaccess to rewrite their query string.&lt;br&gt;
&lt;br&gt;
Any help would be much appreciated, oh tech gods of Mefi!</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.43805</guid>
		<pubDate>Mon, 07 Aug 2006 00:09:49 -0800</pubDate>
		<dc:creator>Vantech</dc:creator>
		
			<category>mod_rewrite</category>
		
			<category>subdomains</category>
		
			<category>dynamic</category>
		
	</item> <item>
		<title>By: PuGZ</title>
		<link>http://ask.metafilter.com/43805/How-can-I-setup-dynamic-sub-domains#672283</link>	
		<description>&lt;pre&gt;RewriteCond %{HTTP_HOST} .&lt;br&gt;
RewriteCond %{HTTP_HOST} !^www\. [NC]&lt;br&gt;
RewriteCond %{HTTP_HOST}&lt;&gt;%{REQUEST_URI} ^([^.]+)\.vantech\.com(:80)?&lt;&gt;/([^/]*) [NC]&lt;br&gt;
RewriteCond %1&lt;&gt;%3 !^(.*)&lt;&gt;\1$ [NC]&lt;br&gt;
RewriteRule ^(.*) /%1/$1 [L] &lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/pre&gt;&lt;br&gt;
That ought to work, but replace vantech.com with your site as required.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43805-672283</guid>
		<pubDate>Mon, 07 Aug 2006 01:05:02 -0800</pubDate>
		<dc:creator>PuGZ</dc:creator>
	</item><item>
		<title>By: Vantech</title>
		<link>http://ask.metafilter.com/43805/How-can-I-setup-dynamic-sub-domains#672287</link>	
		<description>Great reply PuGZ.&lt;br&gt;
&lt;br&gt;
I&apos;m running into trouble with the above ruleset however.  It&apos;s throwing a 500.&lt;br&gt;
&lt;br&gt;
On sub.sub domains - it isn&apos;t working at all.  If the folder exists, it throws the above mentioned server 500.  Any ideas?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43805-672287</guid>
		<pubDate>Mon, 07 Aug 2006 01:26:28 -0800</pubDate>
		<dc:creator>Vantech</dc:creator>
	</item><item>
		<title>By: Vantech</title>
		<link>http://ask.metafilter.com/43805/How-can-I-setup-dynamic-sub-domains#672288</link>	
		<description>As expected... it&apos;s throwing a  mod_rewrite: maximum number of internal redirects reached. to the error_log</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43805-672288</guid>
		<pubDate>Mon, 07 Aug 2006 01:28:29 -0800</pubDate>
		<dc:creator>Vantech</dc:creator>
	</item><item>
		<title>By: PuGZ</title>
		<link>http://ask.metafilter.com/43805/How-can-I-setup-dynamic-sub-domains#672300</link>	
		<description>D&apos;oh, I posted that without properly reading your question. Give me a little while!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43805-672300</guid>
		<pubDate>Mon, 07 Aug 2006 03:01:28 -0800</pubDate>
		<dc:creator>PuGZ</dc:creator>
	</item>
	</channel>
</rss>
