title: Yii redirecting to a different view page after login
body: <p>In my web application I have a page called   "MyHome" which  should be viewed after a successful login.I have included this page under site folder .But it shows  the following error</p>
  
  <pre><code>Error 404
  The system is unable to find the requested action "MyHome".
  </code></pre>
  
  <p>My code for the actionLogin of siteController </p>
  
  <pre><code>public function actionLogin()
  {
  
  
      $model=new LoginForm;
  
  
      if(isset($_POST['ajax']) &amp;&amp; $_POST['ajax']==='login-form')
      {
          echo CActiveForm::validate($model);
          Yii::app()-&gt;end();
      }
  
  
      if(isset($_POST['LoginForm']))
      {
          $model-&gt;attributes=$_POST['LoginForm'];
  
          if($model-&gt;validate() &amp;&amp; $model-&gt;login())
  
      //  $this-&gt;redirect(Yii::app()-&gt;user-&gt;returnUrl);
          $this-&gt;redirect(array('/site/MyHome'));
  
      }
  
      $this-&gt;render('login',array('model'=&gt;$model));
  }
  </code></pre>
  
  <p>My Code for the MyHome view page</p>
  
  <pre><code>&lt;?php /* @var $this Controller */ ?&gt;
  &lt;?php Yii::app()-&gt;bootstrap-&gt;register(); ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;meta name="language" content="en" /&gt;
  
      &lt;!-- blueprint CSS framework --&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl; ?&gt;/css/screen.css" media="screen, projection" /&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl; ?&gt;/css/print.css" media="print" /&gt;
      &lt;!--[if lt IE 8]&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl; ?&gt;/css/ie.css" media="screen, projection" /&gt;
      &lt;![endif]--&gt;
  
      &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl; ?&gt;/css/main.css" /&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl; ?&gt;/css/form.css" /&gt;
  
      &lt;title&gt;&lt;?php echo CHtml::encode($this-&gt;pageTitle); ?&gt;&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div class="container" id="page"&gt;
  
      &lt;div id="header"&gt;
          &lt;div id="logo"&gt;&lt;?php echo CHtml::encode(Yii::app()-&gt;name); ?&gt;&lt;/div&gt;
      &lt;/div&gt;&lt;!-- header --&gt;
  
      &lt;div id="mainmenu"&gt;
          &lt;?php $this-&gt;widget('zii.widgets.CMenu',array(
              'items'=&gt;array(
                  array('label'=&gt;'All offers', 'url'=&gt;array('/producerOffer/index'),'visible'=&gt; Yii::app()-&gt;user-&gt;type==="consumer"),
                  array('label'=&gt;'My requirements', 'url'=&gt;array('/consumerReq/view', array('id'=&gt;Yii::app()-&gt;user-&gt;id)),'visible'=&gt; Yii::app()-&gt;user-&gt;type==="consumer"),
                  array('label'=&gt;'All requirements', 'url'=&gt;array('/ConsumerReq/index'),'visible'=&gt; Yii::app()-&gt;user-&gt;type==="producer"),
                  array('label'=&gt;'My offers', 'url'=&gt;array('/producerOffer/view',array('id'=&gt;Yii::app()-&gt;user-&gt;id)), 'visible'=&gt;Yii::app()-&gt;user-&gt;isGuest),
                  array('label'=&gt;'Logout ('.Yii::app()-&gt;user-&gt;name.')', 'url'=&gt;array('/site/logout'), 'visible'=&gt;!Yii::app()-&gt;user-&gt;isGuest),
  
              ),
          )); ?&gt;
      &lt;/div&gt;&lt;!-- mainmenu --&gt;
      &lt;?php if(isset($this-&gt;breadcrumbs)):?&gt;
          &lt;?php $this-&gt;widget('zii.widgets.CBreadcrumbs', array(
              'links'=&gt;$this-&gt;breadcrumbs,
          )); ?&gt;&lt;!-- breadcrumbs --&gt;
      &lt;?php endif?&gt;
  
      &lt;?php echo $content; ?&gt;
  
      &lt;div class="clear"&gt;&lt;/div&gt;
  
      &lt;div id="footer"&gt;
          Copyright &amp;copy; &lt;?php echo date('Y'); ?&gt; by My Company.&lt;br/&gt;
          All Rights Reserved.&lt;br/&gt;
          &lt;?php echo Yii::powered(); ?&gt;
      &lt;/div&gt;&lt;!-- footer --&gt;
  
  &lt;/div&gt;&lt;!-- page --&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>After a successful login this page must be rendered,Anybody help me how to resolve this issue, since I am a newbie</p>