Take the 2-minute tour ×

So i am using WordPress network sub-domain setup. I had to put a *.mydomain.com as a server alias but now i also have a site subdomain.mydomain.com that leads to another directory. Is there a way of doing this since when i type in subdomain.mydomain.com it just loads the WordPress sign up page.

And yes i do have a v host setup for it

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

I'm assuming that you have two VirtualHosts:

  1. VH for WP that hosts *.mydomain.com
  2. VH for independant webiste that hosts subdomain.mydomain.com

Make sure that your subdomain.mydomain.com VirtualHost is loaded or located in file before the VirtualHost with ServerAlias of *.mydomain.com.

Apache will use the 1st VH it finds that matches ServerName/Alias.

Then restart Apache.


In file it should be...

<VirtualHost *:80>
  ServerName subdomain.mydomain.com

<VirtualHost *:80>
  ServerName mydomain.com
  ServerAlias *.mydomain.com

You can get the default VH and load order by running: httpd -S

share|improve this answer
I did this and the subdomain.mydomain.com loads no matter what. Can you show me an example of the vhost config i need –  xLRDxREVENGEx May 31 '11 at 5:32
xLRDxREVENGEx, edited. –  rightstuff May 31 '11 at 13:25
Do I use documentroot or directory –  xLRDxREVENGEx May 31 '11 at 15:19
xLRDxREVENGEx, I'm not sure what you mean? Each VH block should have a DocumentRoot, and a Directory block giving access and override permissions (and options) for that DocumentRoot. –  rightstuff May 31 '11 at 15:44
Ok well i had this setup before and any time i viewed any site that had mydomain.com it always went to the same page –  xLRDxREVENGEx May 31 '11 at 20:47
show 1 more comment

Your Answer


