Try it on . htaccess file: comments should help you configure it for you ...
This works great for me on several CodeIgniter websites. Also, if mod_rewrite is not installed, it will send you to page 404 (or you can change it for your purpose).
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /
Check the virtual hosts file and see if these elements are installed - this may result in your .htaccess file rewriting URLs correctly
Options FollowSymLinks AllowOverride All Order deny,allow Deny from all
Shane source share