2012-10-29 2 views
1

Я использую каркас Kohana 3.2, я поместил стандартный файл .htaccess в ту же папку приложения.Kohana переписывает urls в .htaccess показывая файл не найденное сообщение

мой .htaccess файл

# Turn on URL rewriting 
RewriteEngine On 

# Installation directory 
RewriteBase /mysite/ 

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

Я попытался изменить линию лас к

RewriteRule ^(.*)$ /index.php/$0 
RewriteRule ^(.*)$ /index.php/$0 [PT,L] 
RewriteRule ^(.*)$ /index.php/$0 [PT,L,QSA] 
RewriteRule .* /index.php/$0 [PT] - [PT,L] - [PT,L,QSA] 

Но он все еще показывает

Не найдено

Запрашиваемая URL /index.php/login не найден на этом сервере веры.

The complete path of the app is /var/www/es/ec/mysite 

The complete working URL is http://10.0.0.1/ec/mysite/index.php/login 

The complete NOT working URL is http://10.0.0.1/ec/mysite/login 

Также ...

Running in Apache 2.2.3 over CentOS 5 

Любая идея ???

ответ

0

Вы можете попробовать мой Кохана .htaccess файл

# Set environment 
SetEnv KOHANA_ENV "development" 

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

Я использую Kohana 3.2, а также. Этот пересмотр, как правило, работает для большинства моих проектов.

Дайте мне знать, как это работает!

+0

Привет, Брент Лингл, я пробую ваш .htaccess, но он по-прежнему показывает, что «Не найдено». Запрошенный URL /index.php не найден на этом сервере ». сообщение. Для записей я использую Apache 2.2.3 на сервере Centos5. – GusCh

0

В вашем bootstrap.php внутри Kohana :: Init установить 'index_file' => '',

+0

Спасибо, Мелиборн, все еще получая то же сообщение. Также попробовали с 'index_file' => 'index.php' и с параметром по умолчанию 'index_file' => FALSE. Есть идеи?? – GusCh

+0

'base_url' => dirname ($ _ SERVER ['SCRIPT_NAME']) – Meliborn

1

Я получил его !!

Вот как это делается, когда приложение находится внутри других папок.

The complete path of the app is /var/www/es/ec/mysite 

The complete working URL is http://10.0.0.1/ec/mysite/index.php/login 

The complete NOT working URL was http://10.0.0.1/ec/mysite/login 

В /var/www/es/ec/mysite/application/bootstrap.php Kohana :: INIT остается как этот

Kohana::init(array(
    'base_url' => '/ec/mysite/', 
    'index_file' => FALSE, 
    'charset' => 'ISO-8859-1', 
)); 

И в .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 .* /ec/mysite/index.php/$0 

Надеюсь, это поможет кому-то еще!

Cheers!