[thelist] .htaccess for two URLs

Edwin Martin edwin at bitstorm.org
Fri Jun 1 04:14:56 CDT 2007

Fred Jonest schreef:
> 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]

Edwin Martin

More information about the thelist mailing list