Apache 2 - RewriteRule - 在安全上下文中注入index.php

时间:2017-11-10 13:39:29

标签: apache mod-rewrite

在我们的服务器上,安全团队禁用了DirectoryIndex,所以我必须弄清楚如何在vhost中添加index.php

它可行,但问题是在子文件夹中,页面资源引用根域名而不是该子文件夹(所以我得到404)

所以添加index.php的RewriteRule似乎弄乱了资源加载,它对我没有任何影响

    RewriteCond "%{REQUEST_URI}" "^/subfolder$"
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^/subfolder$ /subfolder/index.php

我该如何解决这个问题?

感谢

0 个答案:

没有答案