2012-12-18 4 views
-1

모든 요청을 /public/index.php로 리디렉션하는 htaccess 파일이 있습니다.403 htaccess 다시 쓰기를 사용할 때의 오류

AuthType Basic 
AuthName "Access to /testsite" 
AuthUserFile /kunden/homepages/28/d446685396/htpasswd 
Require user oglover 

RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . public/index.php [L] 

모든 요청에 ​​대해 정상적으로 작동합니다. www.mywebsite.com/aboutus, www.mywebsite.com/contact, www.mywebsite.com/news 등 ....하지만 www.mywebsite.com/을 방문하면 403 금지 된 오류가 발생합니다. 모든 것이 새로운 웹 호스트로 옮겨 가면서 문제를 해결할 수 없습니다. .

답변

0
RewriteRule . public/index.php [L] 

이 규칙의 정규식은 "단일 문자 어디서나 문자열에서"이 문제를 일으키는 것을 의미한다. www.mywebsite.com/을 요청하면 정규식과 빈 문자열이 일치합니다 (설명서의 What's being matched? 참조). 정규 표현식이 일치하지 않으므로 규칙이 적용되지 않으므로 서버는 금지 된 루트 색인을 제공하려고 시도합니다.

는 모든 일치 이런 식으로 규칙을 변경하려면 :

RewriteRule .* public/index.php [L] 

.* 수단 "0 개 이상의 문자를", 빈 문자열과 일치 않는다.

관련 문제