The mod_rewrite rule proposed in the official CodeIgniter documentation at http://ellislab.com/codeigniter/user-guide/general/urls.html , which
RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L]
worked fine for me on WAMP
This will also work:
<IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on # Send request via index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule>
In these two options, the only difference is the condition. In principle, the rewrite rule is important. The condition may depend on your requirement.
Both of them did not work on WAMP before. However, the problem was in the Apache settings. rewrite_module was not included. So check to see if this is turned on. You can check if this is allowed with phpinfo () and check the list of loaded modules.
If you are not included, you can enable it using the WAMPserver manager (access to it from the taskbar). Go to Apache> Apache Modules and check the "rewrite_module" box
OR
Open httpd.conf and check if LoadModule rewrite_module modules/mod_rewrite.so uninhibited.
You need to restart WAMPserver to activate the changes.
source share