例如,我在同一个域上有两个不同的站点:
根目录中的第一个站点 http://example.com/
子文件夹中的第二个站点 http://example.com/site2/
每个站点都有自己的 .htaccess
当我进入第二个站点( http://example.com/site2/ )时,在 mod_rewrite 的日志中,我看到 apache 试图执行第一个站点( http://example.com/ )的 .htaccess 。
那么,问题是如何防止这种情况发生?
谢谢
最佳答案
http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions
继承
This forces the current configuration to inherit the configuration of the parent. In per-virtual-server context, this means that the maps, conditions and rules of the main server are inherited. In per-directory context this means that conditions and rules of the parent directory's .htaccess configuration are inherited.
Rules inherited from the parent scope are applied after rules specified in the child scope.
关于apache - 防止执行父文件夹的 .htaccess,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3639281/