How to remove index.php from url in Codeigniter 3?

July 12, 2018 | Category : Codeigniter PHP

Here, I will let you know how to remove inde.php from url using .htaccess in codeigniter project. As we know, codeigniter run index.php and with another route, it's come with index.php file in url. I had same issue on my ubuntu. when i was working on my client project on localhost. i did remove index.php file from url using htaccess file.

So, here you have to simply write below code on your .htaccess file on codeigniter project. let's open and add below code on it.


RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

I hope you found your solution....