나는 내가 달성하고자하는 폴더를 다른 모든 요청이가는 MVC는/공공/IMG가는 모든 이미지 요청 인이htaccess의 mod_rewrite : 루핑을 방지하는 가장 좋은 방법은 무엇입니까?
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가/폴더 내 htdocs에있는 .htaccess 파일을 MVC/public 폴더의 앞쪽 컨트롤러 index.php. 이러한 규칙을 설정하고 mod_rewrite가 루프하지 못하도록하는 가장 좋은 방법입니까? 건너 뛸 S
플래그를 사용
감사합니다. 매력처럼 작동합니다. 그리고 나는 당신이 'S'깃발을 말한 것에 동의합니다. ENV : REDIRECT_STATUS와 관련하여 해당 환경 변수 목록과 좋은 설명이 있습니까? – Dalai