0

I'm trying to make a Virtual SubDomain for my users accounts.

Eg: user.mysite.com

That gets mapped to www.mysite.com/profile/user

I've enabled wildcard DNS in WHM, and Changed my httpd.conf to allow wildcards.

Now, anything.mysite.com gets sent to my Default Homepage, which is great, but a subdomain that I have created forums.mysite.com, Also now goes to the default homepage, and does not re-direct properly!

How do I enable wildcards, but exclude some subdomains?

Thanks.

  • 1
    try putting the virtualhost from forum.mysite.com before the virtualhost that uses wildcard in your httpd.conf, it might workout. – Prix Aug 27 '10 at 05:10

1 Answers1

1

In Apache configuration the order matters, your default VirtualHost should be placed last in the list. Try:

<VirtualHost *:80>
ServerName forum.mysite.com
DocumentRoot /var/www/html/forum/
</VirtualHost>


<VirtualHost *:80>
ServerName www.mysite.com
DocumentRoot /var/www/html/mysite/
</VirtualHost>

<VirtualHost *:80>
ServerName default
ServerAlias *
RewriteEngine On
RewriteRule ^/(.*)$ http://www.mysite.com/ [R]
</VirtualHost>
ghm1014
  • 944
  • 1
  • 5
  • 14