开发者

Only allow certain (dynamic) IP's to visit website director

开发者 https://www.devze.com 2022-12-17 23:41 出处:网络
OK I have 4 dynamic ips, in order to get those IP\'s I need run a gethostbyname(\'domain_name.com\'); on 4 domain names I have that alwasy resolve开发者_开发问答 to the only 4 IP\'s that are allowed

OK

I have 4 dynamic ips, in order to get those IP's I need run a gethostbyname('domain_name.com'); on 4 domain names I have that alwasy resolve开发者_开发问答 to the only 4 IP's that are allowed to access this directory.

This is very easy for me to do on a PHP script on a page, but I am confused as how I can do it to a directory?

Thanks!!


AFAIK you can use hostnames in htaccess, like this:

.htaccess:

Deny From All
Allow From host1.com
Allow From host2.com
0

精彩评论

暂无评论...
验证码 换一张
取 消