1
.htaccess를 사용하여 존재하지 않는 파일/폴더에 액세스하려고하면 로그 대신 404 오류 메시지와 다음 메시지가 반환됩니다.500 존재하지 않는 파일/폴더의 오류
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)/*$ /$1.php?p=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/*$ /$1.php [L]
</IfModule>
코드는 다음과 같이 URL을 변환 :
http://mysite.com/about -> http://mysite.com/about.php
http://mysite.com/something/else -> http://mysite.com/something.php?p=else
의 URL의 캘리포니아 여기
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
코드는 문제를 일으키는 정말 어떤 서버가 찾을 수 없습니다되는 오류를 사용 예컨대 :
http://mysite.com/Idontexist.php
http://mysite.com/nosuchfolder
사람이이 문제를 방지하는 방법을 알고 있나요?
.htaccess 파일의 내용을 영어로 설명하고이 동작을 나타내는 URL을 표시 할 수 있습니까? 분명히 .htaccess 파일이 리디렉션 루프를 일으키고 있습니다. –
@TobyAllen 질문을 업데이트했습니다. – lemondrop