我正试图从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/