I am using WordPress network subdomain setup. I had to put *.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 subdomain.mydomain.com it just loads the WordPress sign up page.

I do have a virtualhost setup for it.


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

| 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.