CodeIgniter – How to remove index.php in URL

2 simple steps.

1. Create or update the .htaccess as follow

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

2. Update the config/config.php file to this

$config[‘index_page’] = ”;

Leave a Reply

Your email address will not be published. Required fields are marked *