title: Redirect to Codeigniter homepage from a controller
body: <p>My default controller is Welcome.php and the index.php file (Home page) shows on the URL localhost://mysite/index.php </p>
  
  <p>When a user go through some process say he comes to the URL localhost://mysite/index.php/FirstController/func </p>
  
  <p>Here I want to send the user to the home page if post data or session data is not available. (i.e if user directly insert the above URL without going through the process). For that I used </p>
  
  <pre><code>$this-&gt;load-&gt;view('index.php');
  </code></pre>
  
  <p>inside the "func" function in "FirstController" controller. But when i do so, my Home page isn't properly displaying because now all the css, js, image files I'm importing will get called in 
  localhost://mysite/index.php/FirstController/func  URL, but not in </p>
  
  <p>localhost://mysite/index.php URL so that each such imported file has to go two more steps backwards to find the correct path.</p>
  
  <p>(Say I'm importing mysite/assets/img/photo1.jpg to my home page, now it's trying to load mysite/FirstController/func/assets/img/photo1.jpg so it gives a 404 error)</p>
  
  <p>So my question is , is there a way to call my Home function from the localhost://mysite/index.php  URL directly or to load Home file inside the "func" function in "FirstController" controller without disturbing its imported file paths.</p>
  
  <p>Thanks in advance.</p>