My current urls look like this [mysite]index.php/[rest of the slug]
.
I want to strip index.php
from these urls.
mod_rewrite
This works for me. Tested in codeigniter 3.1.11, PHP 5.6.40 I use a virtualhost in my apache2 config in testing server.
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot (__DIR__)
ServerName mydomain
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
Require all granted
AllowOverride All
And /.htaccess content
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]