title: Yii redirect is not working correctly in server
body: <p>After login I'm trying to redirect the user based on their user role to their specified page. I tried redirect and header but both is not working for me in the server.  </p>
  
  <p>I tried,  </p>
  
  <pre><code>$this-&gt;redirect('dashboard/profile');  
  $this-&gt;redirect(array('dashboard/profile'));  
  header('Location: dashboard/profile');
  </code></pre>
  
  <p>I'm getting this error  </p>
  
  <pre><code>Cannot modify header information - headers already sent by (output started at /home/deheal/public_html/dev/index.php:2) 
  </code></pre>
  
  <p>This all working perfectly in the local but not in the server please help me.</p>
  
  <p>Thanks in advance.</p>