0

我安装的 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]

当我编写完整的 url www.site.com.br/folder/url 时,它可以工作。

但是现在服务器指向根目录,我需要像www.site.com.br在其他作品中一样,删除folder/.

我尝试了一些选项,但 Kohana 停止工作:

RewriteRule .* folder/index.php/$0 [PT]或者 RewriteRule ^folder/(.*).* index.php/$0 [PT]

4

1 回答 1

0

您只需RewriteBase要从超文本访问脚本中删除 。然后,URI 将在 Kohana 中正确解析。

于 2013-03-26T04:46:37.623 回答