2011-10-25 2 views
1

Kohana 설정을 사용하여 URL에 index.php를 다시 작성합니다. 나는 뿌리 영역을 위해 잘 작동하는 따르는 htaccess 파일이있다. 그러나 누군가가 www.domain.com/learn으로 가면 domain.com/index.php/learn으로 리디렉션됩니다. domain.com/learn으로 리디렉션해야합니다.Kohana Framework를 사용하여 www가 아닌 ​​URL로 리디렉션

# 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] 

#Redirect www to non-www 
RewriteCond %{HTTP_HOST} ^www.ericleslie.com [NC] 
RewriteRule ^(.*)$ http://ericleslie.com/$1 [L,R=301] 

# 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,L] 

답변

0

bootstrap.php을 확인하십시오. (Kohana::init())은 기본적으로 FALSE으로 설정되지 않습니다.

+0

나는 FALSE로 설정했습니다. 사람들이 www가 아닌 ​​URL을 사용하면 잘 작동합니다. www가 아닌 ​​www로 리다이렉트 한 후 index.php 파일을 포함 할 때 발생합니다. – EricLeslie

관련 문제