我对Kohana 3.2的安装效果很好。该站点可导航,CRUD功能也可以使用。他在示例地址:www.site.com.br/folder /.
在.Htacess我有
# Turn on URL rewriting
RewriteEngine On
# Installation directory ()
RewriteBase /folder/
# 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]
当我写完整的网址www.site.com.br/folder/
时,网址会有效。
但是现在服务器指向根目录,我需要像www.site.com.br
,在其他工作中,删除folder/
。
我尝试了一些选择,但Kohana停止了工作:
RewriteRule .* folder/index.php/$0 [PT]
或
RewriteRule ^folder/(.*).* index.php/$0 [PT]
答案 0 :(得分:0)
您只需要从超文本访问脚本中删除RewriteBase
即可。然后,将在Kohana中正确解析URI。