如何通过使用域名而不是IP地址来限制用户访问我的站点。
example.
WWW.fun.com - allow
http://172.20.145.78 - don allow.请帮帮忙
发布于 2011-01-18 13:04:33
设置一个基于虚拟主机名的。如果您正在使用apache,请阅读这。
发布于 2011-01-18 15:29:07
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>这样就行了。
https://serverfault.com/questions/223746
复制相似问题