2012-04-02 93 views
1

我将本地开发从Windows PC迁移到Ubuntu,并且我没有更改Yii上的任何设置。但是当我访问http://localhost时,每个请求都被重定向到我的服务器索引页面(http://www.xxx.com/)。然而,在Windows中,http://localhost将重定向到http://www.xxx.com,但localhost/controller/view不会。现在,所有对Yii的请求都被重定向到服务器(Web根路径中的其他文件不通过Yii的引导程序index.php运行,不会重定向)。可能是什么造成的? 这里是我的保护/配置/ 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

似乎没有要什么不对您main.php可能可能做一个重定向到您的example.com域。可能是你的.htaccess文件?

相关问题