。 大家好,Kohana 404錯誤:請求的網址未找到
我正在爲一個學校項目的網站工作。 最近我在Biberbit.com購買了我自己的webspace,並想上傳我的網站。 當我把它上傳我看到屏幕上出現以下錯誤:
Kohana_HTTP_Exception [ 404 ]: The requested URL/was not found on this server.
我的項目使用Kohana的框架版本3.3.1 我已經有.htaccess文件和文件名/目錄名全部小寫。 我使用的是默認路由:
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'welcome',
'action' => 'index',
));
原本我以爲這可能是在bootstrap.php中文件DEFAULT_URL所以我改變了這些行這樣:
Kohana::init(array(
'base_url' => '/',
'index_file' => FALSE,
));
我已經在多個網站上尋找解決方案,但無法找到適合我的解決方案。 任何人都可以想到我可能會錯過的東西嗎? 我也在爲我的鏈接使用URL::site()
,所以我不認爲這是造成它。
您可以檢查在http://www.biberbit.com
編輯錯誤和/或網站: 的.htaccess的要求
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase/
# 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]
你可以添加.htaccess嗎? – kero
@kingkero我想我在安裝目錄的.htaccess中發現了什麼問題。 – user1433479
當你改變'RewriteBase'時它會工作嗎? – kero