[thelist] .htaccess for two URLs

Fred Jones fredthejonester at gmail.com
Mon Jun 4 04:10:12 CDT 2007


>> I have two domain names and I want the secondary one to be sent to a 
>> subdirectory, meaning that if you request 
>> http://secondsite.com/aboutus.php the server will deliver 
>> http://mainsite.com/secondsite/aboutus.php
>>
>> I tried this
>>
>> RewriteCond %{HTTP_HOST} !mainsite.com
>> RewriteRule ^(.*)$ /secondsite/$1
>>   
> Have you tried this:
> 
> RewriteEngine on
> RewriteCond %{HTTP_HOST} !mainsite.com
> RewriteRule ^(.*)$ /secondsite/$1 [R,L]

Also fails. I enter secondsite.com and get 
mainsite.com/secondsite/secondsite/secondsite ad infinitum until it errors.

I also tried

RewriteRule ^(.*)$ http://mainsite.com/secondsite/$1 [R,L]

and while it works, it changes the URL in the browser, which I don't want.

Fred



More information about the thelist mailing list