I have to close access to website by ip (close access via http://203.0.113.11), but access via domain should be still available.
I've read http://httpd.apache.org/docs/2.0/vhosts/name-based.html (section Using Name-based Virtual Hosts
), configured as recommended:
NameVirtualHost *:80
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
restarted httpd, but this VirtualHost
is still available by ip.
What am I doing wrong?
Answer
Your apache will always use the first virtualhost as the default one.
So before any other vhosts, create another one that points to whichever you want to show all visitors hitting a hostname that doesn't exist within a virtualhost config.
No comments:
Post a Comment