我的 htdocs/MVC/ 文件夹中有一个 .htaccess 文件,看起来像这样
RewriteEngine On
# if its already been rewritten to the specific folder
RewriteCond %{REQUEST_URI} ^/MVC/public/img/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/MVC/public/index.php$
# skip next two rules
RewriteRule .? - [S=2]
# rewrite image requests
RewriteRule (.*\.(jpg|png|gif))$ public/img/$1 [L]
# rewrite all other requests to the front controller index.php
RewriteRule (.*) public/index.php?url=$1 [QSA,L]
我想要实现的是所有图像请求都转到文件夹 MVC/public/img 所有其他请求都转到 MVC/public 文件夹中的前端控制器 index.php。这是设置这些规则并防止 mod_rewrite 循环的最佳方法吗?