2012-04-02 8 views
1

私のローカル開発をWindows PCからUbuntuに移行しましたが、私はYiiの設定を変更しませんでした。しかし、http://localhostにアクセスすると、すべてのリクエストが私のサーバーインデックスページ(http://www.xxx.com/)にリダイレクトされます。ただし、ウィンドウではhttp://localhosthttp://www.xxx.comにリダイレクトされますが、localhost/controller/viewはリダイレクトされません。 Yiiへのすべてのリクエストはサーバーにリダイレクトされます(Yiiのブートストラップindex.phpで実行されないWebルートパス内の他のドキュメントはリダイレクトされません)。おそらくこれが原因でしたか?ここ は私の保護/設定/ main.phpです:Yii 302はローカルホストへのすべてのリクエストをリモートサーバーにリダイレクト

<?php 
return array(
    'id'=>'xxx', 
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..', 
    'name'=>'XXX', 
    'language'=>'zh_CN', 

    // preloading 'log' component 
    'preload'=>array('log'), 

    // autoloading model and component classes 
    'import'=>array(
     'application.models.*', 
     'application.components.*', 
     'application.helpers.*', 
    ), 

    'modules'=>array(
     'gii'=>array(
      'class'=>'system.gii.GiiModule', 
      'password'=>'xxx', 
     ), 
    ), 

    // application components 
    'components'=>array(
     'application'=>array(
      'defaultController'=>'www' 
     ), 
     'urlManager'=>array(
      'urlFormat'=>'path', 
      'showScriptName'=>false, 
      'rules'=>array(
       '<controller:\w+>/<id:\d+>'=>'<controller>/view', 
       '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', 
       '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', 
      ), 
     ), 
     'db'=>array(
      'connectionString' => 'mysql:host=localhost;dbname=xxx', 
      'schemaCachingDuration'=>3600, 
      'emulatePrepare' => true, 
      'username' => 'xxx', 
      'password' => 'xxx', 
      'charset' => 'utf8', 
     ), 
     /*'cache'=>array(
      'class'=>'system.caching.CMemCache', 
      'servers'=>array(
       array('host'=>'127.0.0.1', 'port'=>11211, 'weight'=>60), 
       array('host'=>'127.0.0.1', 'port'=>11211, 'weight'=>40), 
      ), 
     ),*/ 
     /*'session' => array (
      'autoStart'=>'true', 
      'class' => 'system.web.CDbHttpSession', 
      'connectionID' => 'db', 
      'autoCreateSessionTable' => FALSE, 
      'timeout' => 7200, 
      'cookieMode' => 'allow', 
      'cookieParams' => array(
       'path' => '/', 
       'domain' => '.xxx.com', 
       'httpOnly' => TRUE, 
      ), 
     ), 
     'httpCookie'=>array(
      'domain'=>'.xxx.com' 
     ),*/ 
     'user'=>array(
      'loginUrl'=>array('accounts/login'), 
      // enable cookie-based authentication 
      'allowAutoLogin'=>true, 
      'authTimeout'=>'7200' 
     ), 
     'errorHandler'=>array(
      // use 'site/error' action to display errors 
      'errorAction'=>'site/error', 
     ), 
     'log'=>array(
      'class'=>'CLogRouter', 
      'routes'=>array(
       array(
        'class'=>'CFileLogRoute', 
        'levels'=>'error, warning', 
       ), 
       //uncomment the following to show log messages on web pages 
       // array(
         // 'class'=>'CWebLogRoute', 
        //), 
      ), 
     ), 
    ), 

    // application-level parameters that can be accessed 
    // using Yii::app()->params['paramName'] 
    'params'=>array(
     // this is used in contact page 
     'adminEmail'=>'[email protected]', 
    ), 
); 

答えて

0

おそらくあなたexample.comドメインにリダイレクトを行うことができ、あなたのmain.phpに何か問題があるように表示されません。 .htaccessファイルですか?

関連する問題