title: Code Igniter gives 404 when accessing pages without index.php
body: <p>I'm getting 404 errors when accessing via:<br>
  <a href="http://www1.example.me/z/account/login" rel="nofollow">http://www1.example.me/z/account/login</a></p>
  
  <p>Although these work fine:<br/>
  <a href="http://www1.example.me/z/index.php/account/login" rel="nofollow">http://www1.example.me/z/index.php/account/login</a><br>
  <a href="http://www1.example.me/z/" rel="nofollow">http://www1.example.me/z/</a></p>
  
  <p>.htaccess - got it from <a href="http://www.farinspace.com/codeigniter-htaccess-file/" rel="nofollow">this website</a>:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  
      RewriteEngine On
      RewriteBase /
  
      ### Canonicalize codeigniter URLs
  
      # If your default controller is something other than
      # "welcome" you should probably change this
      RewriteRule ^(home(/index)?|index(\.php)?)/?$ / [L,R=301]
      RewriteRule ^(.*)/index/?$ $1 [L,R=301]
  
      # Removes trailing slashes (prevents SEO duplicate content issues)
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.+)/$ $1 [L,R=301]
  
      # Enforce www
      # If you have subdomains, you can add them to 
      # the list using the "|" (OR) regex operator
      RewriteCond %{HTTP_HOST} !^(www|www1) [NC]
      RewriteRule ^(.*)$ http://www1.sherzod.me/z/$1 [L,R=301]
  
      # Enforce NO www
      #RewriteCond %{HTTP_HOST} ^www [NC]
      #RewriteRule ^(.*)$ http://www1.sherzod.me/z/$1 [L,R=301]
  
      ###
  
      # Removes access to the system folder by users.
      # Additionally this will allow you to create a System.php controller,
      # previously this would not have been possible.
      # 'system' can be replaced if you have renamed your system folder.
      RewriteCond %{REQUEST_URI} ^system.*
      RewriteRule ^(.*)$ /index.php/$1 [L]
  
      # Checks to see if the user is attempting to access a valid file,
      # such as an image or css document, if this isn't true it sends the
      # request to index.php
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php/$1 [L]
  
  &lt;/IfModule&gt;
  
  &lt;IfModule !mod_rewrite.c&gt;
  
      # Without mod_rewrite, route 404's to the front controller
      ErrorDocument 404 /index.php
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Configs:</p>
  
  <pre><code>$config['index_page'] = '';
  $config['uri_protocol'] = 'AUTO';
  $route['default_controller'] = "home";
  </code></pre>
  
  <p><strong>UPDATE</strong>:
  Getting this in error_log: <br>
  [Wed Dec 28 17:54:30 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!</p>
  
  <p><strong>Never mind, fixed it.</strong><br><br></p>
  
  <p>Should have been:<br><br></p>
  
  <p>RewriteRule ^(.*)$ z/index.php/$1 [L]<br><br></p>
  
  <p>instead of <br><br></p>
  
  <p>RewriteRule ^(.*)$ index.php/$1 [L]<br><br></p>
  
  <p>because the code is inside of z folder. Thanks for visiting. :)</p>