重写删除index.php,不能正常工作Kohana


Re-writing to remove index.php, not working properly Kohana

我正试图从url中摆脱index.php

现在Kohana正在提供前面没有index.php的url,但是,这些url将转到一个未找到的页面。

当我在url之前手动输入index.php时,像/index.php/login这样的东西会工作

但是系统本身指向/login,这导致了一个not found错误。

我在我的。htaccess文件中有以下内容,复制自Kohana

RewriteRule .* index.php/$0 [PT]对我没有任何作用

如果有人知道幕后发生了什么,那就太好了。

try this:

# ----------------------------------------------------------------------
# Start rewrite engine
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
 # Make sure directory listing is disabled
Options +FollowSymLinks -Indexes
RewriteEngine on
# Send request via index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

</IfModule>

,如果仍然不能工作,在RewriteEngine on

后面添加这一行
RewriteBase /

RewriteBase /your-application-folder/