2012-05-30 3 views
0

내가 .htaccess 다음 파일을 한 다시 작성 htaccess로 misterium :아파치,

그것은 작동
RewriteEngine On 
RewriteBase/
RewriteRule ^plugins/.* pluginLoader.php [L] 
RewriteRule ^settings\.php index.php [L] 
RewriteCond %{REQUEST_FILENAME} !-f [OR] 
RewriteCond %{REQUEST_FILENAME} \.art$ [OR] 
RewriteCond %{REQUEST_FILENAME} /system/ 
RewriteRule .* index.php [L] 

예상 방법, plugins 디렉토리에 위치하고 확장없이 기존 파일의 이름으로 URL 포인트까지. 나는 이유를 모른다. 예를 들어 /plugins/invoice/name.txt 파일이 있습니다.

http://localhost/plugins/invoice/name.txt 
    uses pluginLoader.php as expected 
http://localhost/plugins/invoice/name. 
    uses pluginLoader.php as expected 
http://localhost/plugins/invoice/name 
    uses index.php! Why? 
http://localhost/plugins/invoice/nam 
    uses pluginLoader.php as expected 

동일 .txt 또는 .php 확장자를 가진 모든 파일에 적용됩니다. 파일에 .sql 확장자가있는 경우 pluginLoader.php이나 index.php을 사용하지 않습니다. 을 404 - 찾을 수 없습니다..

일부 전 처리기가 있습니까? 무엇

도 흥미 롭다 :

RewriteEngine On 
RewriteBase/
RewriteRule ^plugins/.* pluginLoader.php [L] 
RewriteRule ^settings\.php index.php [L] 

가 작동하게 마지막 네 줄을 삭제합니다. 그러나 URL http://localhost/plugins/invoice/fill은 여전히 ​​404 오류가 발생합니다. 파일의 이름이 바뀌면 URL이 작동합니다.

미스터리 ...

+0

디버깅하는 가장 좋은 방법은 시스템에만 국한 될 수 있기 때문에 - 가장 높은 수준에서 디버깅을 재 작성하고 로그를 분석 할 수 있습니다 (로컬/dev 서버에서 트래픽을 거의 또는 전혀 테스트하지 않았 으면 좋겠다. 그렇지 않으면 로그 파일이 커져서 디버그하기가 어렵습니다. http://httpd.apache.org/docs/current/mod/mod_rewrite.html#logging (2.4 용, 2.2 브랜치의 경우 http://httpd.apache.org/docs/2.2/mod/mod_rewrite) .html # rewritelog) – LazyOne

+0

'Options -MultiViews'는 'name-clash'문제를 수정해야합니다. – Gerben

답변

0

이 당신의 htaccess로 코드를 교체하고이 도움이 있는지 확인 :

Options +FollowSymLinks -MultiViews 
# Turn mod_rewrite on 
RewriteEngine On 
RewriteBase/

RewriteRule ^plugins/ pluginLoader.php [L,NC] 

RewriteRule ^settings\.php/?$ index.php [L,NC] 

RewriteCond %{REQUEST_FILENAME} !-f [OR] 
RewriteCond %{REQUEST_FILENAME} \.art$ [OR] 
RewriteCond %{REQUEST_FILENAME} /system/ 
RewriteRule^index.php [L] 

$DOCUMENT_ROOT/plugins 디렉토리에는 htaccess로이없는 것을 확인.