Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好的
我有 4 个动态 ip,为了获得这些 IP,我需要gethostbyname('domain_name.com');在 4 个域名上运行一个我总是解析为允许访问此目录的唯一 4 个 IP。
gethostbyname('domain_name.com');
这对我来说很容易在页面上的 PHP 脚本上执行,但我很困惑如何对目录执行此操作?
谢谢!!
AFAIK,您可以在 htaccess 中使用主机名,如下所示:
.ht 访问:
Deny From All Allow From host1.com Allow From host2.com