How to restrict users to go to my site only by using the domain name not by the IP address.

WWW.fun.com - allow - don allow.

Please help

  • 2
    what web server are you using?
    – JP19
    Jan 18 '11 at 11:17
  • 1
    Since this is a web server configuration issue, it should probably be posted on serverfault. Also, the "accessibility" tag is a bit misleading here. Jan 18 '11 at 12:29

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

<VirtualHost *:80>
ServerName www.fun.com
ServerAlias fun.com *.fun.com
DocumentRoot /path/to/your/webroot

That should do it.

Your Answer

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