我正在開發一個使用Kohana 3的網站(第一次使用框架)。在當地,一切都很完美。目前,我有一個默認模板控制器,一個多語言支持,我的'index.php'被正確刪除。所以在進一步研究之前,我測試了它是否在我的服務器上運行,並且我得到了無限循環。Ko3 - URL重寫問題 - 刪除index.php
我跟着從多語言實現的非官方維基教程:http://www.kerkness.ca/wiki/doku.php?id=example_of_a_multi-language_website
如果在URI中未指定的語言,所以我想通這個問題可能已經從那裏來產生一個重定向到默認語言即使它在本地工作,所以我刪除它看看沒有重定向會發生什麼。現在,我可以看到我的主頁,但無論網頁瀏覽器中的uri是什麼,總是會調用主頁。我在我的主視圖中插入以下行來檢查uri是什麼: request :: instance() - > uri()並且實際上,uri總是:/ en/home/
我把索引。 PHP的後面(在引導程序),一切工作正常,即使重定向到默認語言。
我的第一個猜測是,URI沒有被正確重寫,所以我試圖改變的.htaccess,但沒有成功......
這裏是我的.htaccess:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /dev/
# 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)/ - [F,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]
(順便說一句我也試過在非官方維基其他重寫規則,也不管用)
附加信息: 主持人:WebHostingPad的 阿帕奇:v2.2.11 PHP:5.2.9
Rewrite_Module被激活
謝謝你,我會很感激你的幫助,因爲我一直在努力,現在解決這個問題了幾天,它的真正開始激怒我;)