2014-05-12 32 views
0

我目前正在開發自己的網站應用程序,我需要測試它活的服務器上。的Yii:服務器問題控制器動作總是找不到404

在本地機器上它是活的服務器不工作。但是運作良好。

這裏是我的問題描述:

When I access the domain root folder "mydomain.com" it is working. 
It displays the 
webpage index. But when I try to access site/action it 
gives me 404 not found. Same thing happens for other controller action. 

有誰能夠告訴我什麼是wrong..I我不是專家,活的服務器,所以我沒有在術語好,我只能形容正在發生的事情。

我不知道這是否是值得一提,但我使用的警予urlManager

與此設置

'urlManager'=>array(
      'urlFormat'=>'path', 
      'rules'=>array(
       '<action:\w+>' => 'site/<action>', 
       '<controller:\w+>/<id:\d+>'=>'<controller>/view', 
       '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', 
       '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', 
      ), 
      'showScriptName'=>false 
     ), 

並在根文件夾一個htaccess ..

服務器:LAMP

非常感謝您的幫助..每個人都在讚賞。

+0

你確定htaccess的工作?因爲對我來說,這聽起來像服務器沒有路由您的請求 – Asped

+0

我相信因爲我已經在本地機器上測試過它,但是我不確定是否啓用了服務器的mod_rewrite ..我不太確定X_X ..還404未找到的問題不是由我的應用程序生成的,而是由apache生成的,但是根url正在工作。 – NEWBIE

+0

當然是根工作了,因爲這是標準的服務器動作,也是標準的Yii路由。我相信你的htaccess不在服務器上,或者你說mod_rerite沒有啓用。檢查你的服務器管理員,檢查/請求你的服務器日誌,否則沒有人可以幫助 – Asped

回答

5

我有同樣的問題,我的控制器名稱是UserManagementController,它在Windows上工作得很好,但是當我將它移動到Linux時,我收到錯誤「無法解析請求'usermanagement'」。

的問題是,Linux是區分大小寫的。我將控制器名稱從UserManagementController更改爲UsermanagementController,並且工作正常。