Configuring an apache virtualhost to link to another's virtualhost's subdomain

Posted by Laurent Van Winckel on Server Fault See other posts from Server Fault or by Laurent Van Winckel
Published on 2010-11-05T02:08:49Z Indexed on 2011/01/12 5:55 UTC
Read the original article Hit count: 262

Filed under:

I have a domain on my server (on its own virtualhost), e.g., which has a lot of subdomains with content on it.


This virtualhost looks like this:

 ServerAdmin [email protected]
 ServerAlias *
 DocumentRoot /var/www/

I want to put other domains on the server and have each of them link to a specific subdomain on I don't want it to redirect. I want a similar behavior as the [L,PT] flags on mod rewrite.

I've tried this:

 ReWriteEngine on
 RewriteCond %{HTTP_HOST} ^$ [NC]
 RewriteRule ^(.*)$$1 [PT,L]

But it is giving me a 400 Bad request error.

How would I configure such a virtualhost?

© Server Fault or respective owner

Related posts about apache

Related posts about virtualhosts