In
application/config/config.php
change:$config['index_page']='index.php';
to:
$config['index_page']='';
Create or modify .htaccess in project root with following content.
# Customized error messages.
ErrorDocument 404 /index.php
# Set the default handler.
DirectoryIndex index.php
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>
Also allow overriding htaccess in your apache
/etc/apache2/sites-available/default
and edit the file & change to
AllowOverrideAll
and
Restart Apache
sudo /etc/init.d/apache2 reload
or:
sudo service apache2 reload
or:
sudo /etc/init.d/httpd reload
nice.. thank a lot, my problem solved.
ReplyDelete