我想在我的apacheconfiguration中添加一个条件,如果请求来自特定的IP,然后加载一个特定的configuration文件。 这可能吗?
例如
if (192.168.1.1) Include conf/mod_security.conf
您不能select在您的基于访问者的Apacheconfiguration中包含configuration文件。 这是因为apache一开始就编译所有的configuration数据。 你可以根据访问者的IP进行mod_rewrite规则的调整,也可以使用mod_access 。
Apache的“include”指令只在主configuration或上下文中有效。 这个指令有很多可用的文档 。