防止执行父文件夹的 .htaccess

Ale*_*lex 6 apache .htaccess mod-rewrite

我在同一个域上有两个不同的站点,例如:
根目录中的第一个站点http://example.com/
子文件夹中的第二个站点http://example.com/site2/
每个站点都有自己的 .htaccess
当我进入第二个站点(http://example.com/site2/),在 mod_rewrite 的日志中,我看到 apache 试图执行第一个站点(http://example.com/)的.htaccess 。
那么,问题是如何防止这种情况发生?谢谢

小智 2

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions

继承

这会强制当前配置继承父级的配置。在每个虚拟服务器的上下文中,这意味着继承主服务器的地图、条件和规则。在每个目录上下文中,这意味着继承父目录的 .htaccess 配置的条件和规则。

Rules inherited from the parent scope are applied after rules specified in the child scope.