我最近將我的應用程序從Windows本地主機遷移到Linux主機。Kohana 3部署控制器問題
我的問題是,我無法訪問控制器,我總是不斷收到消息:找不到文件(從Web服務器)
這是奇怪,因爲相同的代碼庫正在我本地主機。
bootstrap.php中:
Route::set('default', '(<controller>(/<action>(/<id>)(/<param1>)(/<param2>)))')
->defaults(array(
'controller' => 'user',
'action' => 'index',
'param1' =>'',
'param2' =>'',
));
的.htaccess:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase/
# 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.myapp.com/那麼默認控制器執行並找到用戶/索引功能。
但是,如果我手動將它寫爲www.myapp.com/user/index我不斷收到File not found消息。
我試着用小寫重命名控制器文件,所以我猜這不是問題,除此之外,如果這將是問題,默認路由不會在第一個地方找到它,對嗎?
舉例來說,如果我寫的默認路由:
Route::set('default', '(<controller>(/<action>(/<id>)(/<param1>)(/<param2>)))')
->defaults(array(
'controller' => 'user',
'action' => 'login',
'param1' =>'',
'param2' =>'',
));
我accesss www.myapp.com,它會加載用戶的功能。我無法弄清楚這裏有什麼問題,爲什麼當我寫myapp.com/user/login時說沒有找到文件,但是如果我把它作爲默認路由,它會打開它。