title: CodeIgniter 4 redirect function not working
body: <p>After logout, I tried to redirect for the home page. I tried to few ways, but not redirected.</p>
  
  <pre><code>class User extends BaseController
  {
      public function __construct()
      {
          helper('url');
      }
  </code></pre>
  
  <p>for the logout function. I used three ways</p>
  
  <pre><code>redirect('/');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>header("Location:".base_url());
  </code></pre>
  
  <p>or</p>
  
  <pre><code>route_to('/');
  </code></pre>