title: Remove index.php From URL - Codeigniter 2
body: <p>I am having trouble removing index.php from my URLs in Codeigniter. I've made a few websites with Codeigniter 1.7 and the .htaccess code I used doesn't work in 2.</p>
  
  <p>I have tried using </p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  
  RewriteCond %{REQUEST_URI} ^system.*
  RewriteRule ^(.*)$ /index.php?/$1 [L]
  
  RewriteCond %{REQUEST_URI} ^application.*
  RewriteRule ^(.*)$ /index.php?/$1 [L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  RewriteCond $1 !^(index\.php|images|robots\.txt|css)
  RewriteRule ^(.*)$ ./index.php/$1 [L]
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I've also tried it without RewriteBase / in.</p>
  
  <p>I have changed the $config['uri_protocol'] to REQUEST_URI and QUERY_STRING and nothing.</p>
  
  <p>I have set $config['index_page'] = "";</p>
  
  <p>The file structure is 192.168.0.130/(site)/ so it must be going back to the root of the server and can't find the index.php file.</p>
  
  <p>All of the controllers I have made can be reached by putting 192.168.0.130/(site)/index.php/testcontroller</p>
  
  <p>Thank you.</p>
  
  <p>Apologies if this has been asked before - I have looked and tried what I could see.</p>
  
  <p>Edit:</p>
  
  <p>I should also add that I changed the default folders to be </p>
  
  <p>application</p>
  
  <p>CI-2.0</p>
  
  <p>index.php</p>
  
  <p>and changed the paths in index.php to be correct.  </p>