My current urls look like this [mysite]index.php/[rest of the slug]
.
I want to strip index.php
from these urls.
mod_rewrite
In CodeIgniter 3.16 in using htaccess to
remove index.php file
& also
redirect HTTP to HTTPS
Follow are the codes:
application\config\config.php
file Make changes
$config['index_page'] = 'index.php';
To
$config['index_page'] = '';
RewriteEngine on
RewriteBase /
## Redirect SSL
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]
## Remove fron url index.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^/(index\.php|assets/|humans\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]