How to change the url for Yii::app()->homeUrl in Yii

H

How Can We Help?

How to change the url for Yii::app()->homeUrl in Yii

  1. Open the main configuration file protected/config/main.php
  2. Now in the main.php file we can assign a Action or Url to homeUrl
    _highlight[1] = “\n\nreturn array(\n\n \’basePath\’=>dirname(__FILE__).DIRECTORY_SEPARATOR.\’..\’,\n\n  \’homeUrl\’=>array(\’site/login\’),\n\n  ….\n\n”;

    return array(
     
     'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
     
      'homeUrl'=>array('site/login'),
     
      ....

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me