I’m trying to remove ‘index.php’ from my URI, but I can’t seem to get it to work.
i.e. I want it to read ‘http://example.com/blog/’ rather than ‘http://example.com/index.php/blog/’
Can anybody please let me know what I’m doing wrong?
My .htaccess file is in my site’s root (as is my CI installation). I got this from the CI wiki:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#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]
</IfModule>
<IfModule !mod_rewrite.c>
# 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
</IfModule>
And I also changed my system/application/config/config.php so that the ‘index_page’ line says:
$config['index_page'] = '';
But it’s still not working - I still need to include /index.php/ in the URI for it to work properly. What am I missing? Thanks in advance for any help!