title: YII how to handle custom 404 error page along with other error pages
body: <p>I want to display 404 error page for that i have made error404.php file in my protected/view/system folder. </p>
  
  <p>By default i have Sitecontroller and it contained error action function as below</p>
  
  <pre><code>public function actionError()
  {
      if($error=Yii::app()-&gt;errorHandler-&gt;error)
      {
  
          if(Yii::app()-&gt;request-&gt;isAjaxRequest)
              echo $error['message'];
          else
              $this-&gt;render('error', $error);
      }
  }
  </code></pre>
  
  <p>inside main config file it is defined as </p>
  
  <pre><code>    'errorHandler'=&gt;array(
          // use 'site/error' action to display errors
          'errorAction'=&gt;'site/error',
      ),
  </code></pre>
  
  <p>my problem is i need to customize 404 page only, rest of the error i need to handle the way it is being handle by sitecontroller's error function. But i could not find a way to do that. If suppose i remove  'errorAction'=>'site/error', from the config main then it does show the 404 error by calling </p>
  
  <pre><code>        throw new CHttpException(404, 'Page not found');
  </code></pre>
  
  <p>but doing that i can only see the page without layout also other custom errors are treated same as 404 while they are not. I read the manual many times but i still cant able to resolve it. </p>