2011-02-17 5 views
0

내 url은이htaccess로는

localhost/luz/home -> read home.php file 
localhost/luz/content/about -> read content.php?page=about 

같은 것입니다 어쨌든 그것은 완전히 작동하지 않습니다.

localhost/luz/home -> SUCCESS 
localhost/contenttt -> internal server error (contenttt.php doesn't exist and the 404 doesn't work) 
localhost/content/about -> somehow it loads content.php?page=about.php/about 

내 htaccess로는 간단하다

RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteCond %{SCRIPT_FILENAME} !-f 
RewriteRule ^(.*)$ $1.php 
RewriteRule ^content/(.*)$ content.php?page=$1 
ErrorDocument 404 /404.php 

답변

1

대체 실제로 기존 파일 참조하는 경우 당신은 확인해야합니다 :

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME}.php -f 
RewriteRule ^(.*)$ $1.php 

그렇지 않으면 당신이 마지막에 .php을 추가하는 무한 재귀를 얻을 것이다 때마다.

관련 문제