I'm trying to route a top level domain through Apache Virtual Hosts, but I can't seem to get it to work.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName mydomain.net
ServerAlias www.mydomain.net
DocumentRoot /var/www/tgc
</VirtualHost>
www.mydomain.net
works perfectly. But mydomain.net
continues to route to /var/www
. I've tried suggestions here and many different combinations, but nothing seems to work.
apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server mydomain.net (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost mydomain.net (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost mydomain.net (/etc/apache2/sites-enabled/000-default:54)
Syntax OK
httpd -S
.