<?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: getting .htaccess to do httpd.conf's job</title>
	<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job/</link>
	<description>Comments on Ask MetaFilter post getting .htaccess to do httpd.conf's job</description>
	<pubDate>Mon, 02 Jun 2008 04:14:25 -0800</pubDate>
	<lastBuildDate>Mon, 02 Jun 2008 04:14:25 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: getting .htaccess to do httpd.conf&apos;s job</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job</link>	
		<description>Mod_rewrite and subdirectories and subdomains, oh my! &lt;br /&gt;&lt;br /&gt; I&apos;m using a hosting service (Lunarpages) that maps the document root of subdomains to a corresponding subdirectory in the primary domain root (i.e. the public_html directory). Thus: &lt;tt&gt;sub1.mysite com&lt;/tt&gt; has &lt;tt&gt;mysite.com/sub1/&lt;/tt&gt; as its &lt;tt&gt;/&lt;/tt&gt; directory.&lt;br&gt;
&lt;br&gt;
I&apos;ve also got &lt;tt&gt;sub2.mysite.com&lt;/tt&gt;, which has its document root automatically and unalterably set to &lt;tt&gt;mysite.com/sub2/&lt;/tt&gt;. I would like URLs to &lt;tt&gt;sub2.mysite.com&lt;/tt&gt; to be rewritten so that they go to &lt;tt&gt;sub1.mysite.com&lt;/tt&gt;. A standard external redirect isn&apos;t going to work in this case, because the code in &lt;tt&gt;/foo/&lt;/tt&gt; needs to parse the incoming subdomain. &lt;br&gt;
&lt;br&gt;
Got .htaccess, anyone?&lt;br&gt;
&lt;br&gt;
(This is, of course, something that would take 0.3s to solve if I could get at the bloody httpd.conf.)</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2008:site.92955</guid>
		<pubDate>Mon, 02 Jun 2008 03:37:58 -0800</pubDate>
		<dc:creator>holgate</dc:creator>
		
			<category>mod_rewrite</category>
		
			<category>apache</category>
		
			<category>web</category>
		
			<category>server</category>
		
			<category>htaccess</category>
		
	</item> <item>
		<title>By: Remy</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job#1360585</link>	
		<description>Place .htaccess in ~/public_html/sub2/ with this line:&lt;br&gt;
&lt;br&gt;
Redirect / http://sub1.mysite.com/&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://httpd.apache.org/docs/1.3/mod/mod_alias.html#redirect&quot;&gt;More on mod_alias&lt;/a&gt;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92955-1360585</guid>
		<pubDate>Mon, 02 Jun 2008 04:14:25 -0800</pubDate>
		<dc:creator>Remy</dc:creator>
	</item><item>
		<title>By: holgate</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job#1360608</link>	
		<description>Thanks, but that&apos;s a straight redirect.&lt;br&gt;
&lt;br&gt;
Let me clarify: I need the URL to read &lt;tt&gt;sub2.mysite.com&lt;/tt&gt;, but the content to be drawn from the &lt;tt&gt;sub1.mysite.com&lt;/tt&gt; hierarchy.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92955-1360608</guid>
		<pubDate>Mon, 02 Jun 2008 05:05:35 -0800</pubDate>
		<dc:creator>holgate</dc:creator>
	</item><item>
		<title>By: devbrain</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job#1360625</link>	
		<description>Unless I misunderstand the problem (which may be likely), a symlink behind the scenes might do what you seek.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92955-1360625</guid>
		<pubDate>Mon, 02 Jun 2008 05:38:49 -0800</pubDate>
		<dc:creator>devbrain</dc:creator>
	</item><item>
		<title>By: wangarific</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job#1360629</link>	
		<description>i don&apos;t use lunarpages so I don&apos;t know who you ask to have this done but you&apos;ll want someone to alter the dns zonefile so that the sub1 subdomain access the subdirectory (that way sub1.mysite.com appears the same in your browser&apos;s address bar).&lt;br&gt;
&lt;br&gt;
if you tell them what&apos;s what you want, they should be able to help you out</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92955-1360629</guid>
		<pubDate>Mon, 02 Jun 2008 05:47:18 -0800</pubDate>
		<dc:creator>wangarific</dc:creator>
	</item><item>
		<title>By: enn</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job#1360659</link>	
		<description>If you don&apos;t want a client-side redirect, why not:&lt;br&gt;
&lt;br&gt;
Alias / /home/holgate/public_html/sub1/</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92955-1360659</guid>
		<pubDate>Mon, 02 Jun 2008 06:28:18 -0800</pubDate>
		<dc:creator>enn</dc:creator>
	</item><item>
		<title>By: nev</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job#1360783</link>	
		<description>You want the proxy flag in mod_rewrite (but note that mod_proxy also needs to be installed).  Something like this:&lt;br&gt;
&lt;br&gt;
RewriteCond %{HTTP_HOST} sub2.mysite.com&lt;br&gt;
RewriteRule /(.*) http://sub1.mysite.com/$1 [P]&lt;br&gt;
&lt;br&gt;
Proxying will pass the request through to sub1 but you&apos;ll have access to the original hostname for processing.&lt;br&gt;
&lt;br&gt;
Note that users will see sub2.mysite.com in their browser, always.  If you need them to see sub1 then you&apos;ll have to use RewriteRule to set a flag along with external redirection, which is inconvenient and fragile.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92955-1360783</guid>
		<pubDate>Mon, 02 Jun 2008 08:03:46 -0800</pubDate>
		<dc:creator>nev</dc:creator>
	</item><item>
		<title>By: holgate</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job#1362418</link>	
		<description>Proxy flag is it, but they want to upsell to enable mod_proxy. Gah. Thanks, anyway.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92955-1362418</guid>
		<pubDate>Tue, 03 Jun 2008 08:25:15 -0800</pubDate>
		<dc:creator>holgate</dc:creator>
	</item><item>
		<title>By: nev</title>
		<link>http://ask.metafilter.com/92955/getting-htaccess-to-do-httpdconfs-job#1363666</link>	
		<description>Sorry, that&apos;s totally lame.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.92955-1363666</guid>
		<pubDate>Wed, 04 Jun 2008 06:25:08 -0800</pubDate>
		<dc:creator>nev</dc:creator>
	</item>
	</channel>
</rss>
