title: CodeIgniter: Mod_Rewrite on Xampp
body: <p>After 3 days of trying to figure out how to get mod_rewrite working in xampp, I finally tried the CodeIgniter forum. But even they couldn't give me the answer I need.
  My original post on the CI forum can be found here: <a href="http://codeigniter.com/forums/viewthread/221002/" rel="nofollow">http://codeigniter.com/forums/viewthread/221002/</a></p>
  
  <p>The problem is, I am sure I did everything in order to enable mod_rewrite:</p>
  
  <p>In apache/config/httpd.conf:
  Uncommented that one line that enabled mod_rewrite module.
  Replaced every line "AllowOverride None" with "AllowOverride All".</p>
  
  <p>In CI/application/config/config.php:</p>
  
  <ul>
  <li>$config['base_url'] = '';</li>
  <li>$config['index_page'] = '';</li>
  <li>$config['uri_protocol']   = 'REQUEST_URI';</li>
  </ul>
  
  <p>In CI/application/config/routes.php:</p>
  
  <ul>
  <li>$route['default_controller'] = "user";</li>
  </ul>
  
  <p>My .htaccess file is located in the same folder where the application folder can be found. The .htaccess file looks like this:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /localhost/Tong-Il/
  
  #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]
  
  #When your application folder isn't in the system folder
  #This snippet prevents user access to the application folder
  #Submitted by: Fabdrol
  #Rename 'application' to your applications folder name.
  RewriteCond %{REQUEST_URI} ^application.*
  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]
  php_flag short_open_tag off
  php_flag magic_quotes_gpc Off
  &lt;/IfModule&gt;
  
  &lt;IfModule !mod_rewrite.c&gt;
  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.
  # Submitted by: ElliotHaughin
  
  ErrorDocument 404 /index.php
  &lt;/IfModule&gt;  
  </code></pre>
  
  <p>My site is called Tong-Il, so when I browse to /localhost/Tong-Il/, I get my homepage and everything loads fine (seperate header, footer and menu view + connection to database). But as soon as I click a link anywhere on my homepage, I get the 404 error!</p>
  
  <p>Any link I click will be handled by the "user" controller. So when I press "galery" in my menu, I get the 404 error page with this url: localhost/Tong-Il/user/images.
  When I change this to localhost/Tong-Il/index.php/user/images it works fine!
  My website can be found online, but I uploaded it a while ago. Everything is working online (including mod_rewrite), but just to give you an idea: www.tong-il-neeroeteren.be</p>
  
  <p>Is there ANYONE out there that can help me solve this?</p>