How to restrict users to go to my site only by using the domain name not by the IP address.
example. WWW.fun.com - allow http://172.20.145.78 - don allow.
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Set a virtualhost name-based. If you are using apache, read this.
NameVirtualHost *:80 <VirtualHost _default_:80> ServerName ip.add.re.ss DocumentRoot /path/to/somewhere/else <Directory /path/to/somewhere/else> Order deny,allow Deny from all </Directory> </VirtualHost> <VirtualHost *:80> ServerName www.fun.com ServerAlias fun.com *.fun.com DocumentRoot /path/to/your/webroot </VirtualHost>
That should do it.