title: What happens when a user types only the domain name and or port number in the browser's address bar when accessing a site built with codeigniter?
body: <p>I know that in Codeigniter, the default controller is always called if a controller is not specified in the url. Furthermore, if a function is not specified in the url, the index function of the controller will be called by default. However when I enter the following urls in the browser address bar I get different results for each:</p>
  
  <pre><code>http://localhost/appfolder/
  </code></pre>
  
  <p>And</p>
  
  <pre><code>http://localhost/appfolder/index.php/defaultController
  </code></pre>
  
  <p>For the first url, it seems that the user is not logged in even if indeed the user is logged in. The second url works fine and does the correct thing whether the user is logged in or not, that is, it excecutes the index function of the default controller. It seems to me that the first url doesn't excecute the index function of the default controller. I'm racking my brain trying to figure out why entering the two urls produces different results because according to what I know, they're supposed to have the same results; i.e they're both supposed to call the index function of the default controller.
  I'm sort of a newbie in using codeigniter (have used it for about 2 and half months now) so any help would really be appreciated.</p>
  
  <p><strong>This is an edit:</strong>
  I know most of the comments here are about using a htaccess file but isn't it supposed to work the same way whether index.php is in the url or not? Does anyone have any other suggestions on what I can do to pinpoint the problem?</p>