[英]Re-writing to remove index.php, not working properly Kohana
我试图摆脱URL中的index.php
。
现在,Kohana提供的网址之前没有index.php
,但是这些网址将转到未找到的页面。
当我在网址之前手动输入index.php
时,/ index.php
/index.php/login
类的/index.php/login
会起作用
但是系统本身会定向到/login
,这会导致未找到错误。
从Kohana复制的.htaccess文件中包含以下内容
RewriteRule .* index.php/$0 [PT]
对我没有任何帮助。
如果有人对幕后发生的事情有任何线索,那就太好了。
尝试这个 :
# ----------------------------------------------------------------------
# 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/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.