【问题标题】:Rewrite to remove url - kohana 3.2 and .htacess重写以删除 url - kohana 3.2 和 .htaccess
【发布时间】:2013-03-25 23:27:18
【问题描述】:

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

【问题讨论】:

    标签: .htaccess kohana kohana-3.2


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2014-10-06
      • 2015-07-17
      • 2013-09-15
      • 1970-01-01
      • 1970-01-01
      • 2016-01-02
      • 2020-01-09
      • 2020-09-09
      • 2018-05-25
      相关资源
      最近更新 更多