View Single Post
Old 8th August 2012, 04:42
tahunasky tahunasky is offline
Join Date: Jul 2012
Location: Buenos Aires
Posts: 84
Thanks: 1
Thanked 9 Times in 9 Posts
Default Apache - same subdomain on multiple domains


Is there a way in apache to have the same subdomain on multiple domains point to the same doc root without having to have a virtualhost directive for each domain.
I am hosting multiple domains on the same server with the same subdomain names - &, &, & etc and want all the mail subdomains to point to /opt/webmail/ and all the cloud subdomains to point to /opt/cloud/. I have tried the below but it doesnt work.

<VirtualHost *:443> 
  ServerAlias mail.* 
  DocumentRoot /opt/webmail 

<VirtualHost *:443>
  ServerAlias cloud.* 
  DocumentRoot /opt/cloud 
I would like something that i dont have to touch again even if i add/remove domains - any ideas how i can do this ?


Last edited by tahunasky; 8th August 2012 at 16:43.
Reply With Quote
Sponsored Links