로컬 아파치 서버에서 Kohana 설정을 실행하고 있습니다. 나는 kohana 디렉토리에서 index.php 파일을 저장하는 'htdocs'폴더를 만들었습니다. 따라서 시스템 파일은 방문자가 사용할 수 없습니다. 이제는 다른 컨트롤러를 방문 할 때마다 URL에서 index.php를 제거하지 않으므로 제공된 .htaccess로 속일려고했으나 제대로 작동하지 않습니다. 이걸 가진 사람이 있니?. Khana 3.0의 .htaccess 규칙은 무엇입니까?
htaccess로 파일 :
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase/
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
파일이 kohana 디렉토리에 위치합니다. 분명히 RewriteBase 변수를 변경하기로되어 있지만, 무엇이되어야하는지에 대해서는 알지 못합니다.
입니다. 링크를 제공해 주셔서 감사합니다. 너의 팁은 나를 위해 실제로 운동하지 않았다. 내 kohana 디렉토리 주소는 다음과 같습니다. http : // localhost/kohana/htdocs .htaccess는 kohana 폴더에 있습니다. 그러면 'RewriteBase/kohana/htdocs'여야합니까? (작동하지 않습니다) –
죄송합니다. mod_rewrite 전문가도 아니지만, http : // localhost/kohana/htdocs/index.php와 같은 index.php 파일에 접근 할 수 있다면 RewriteBase는/kohana/htdocs 내가 아는 한. – svens