Steps to remove index.php from url codeigniter :-

Config changes :- Go to “application/config/config.php
Find below code:-

$config[‘index_page’] = ‘index.php’;
Replace with the below code:-

$config[‘index_page’] = ”;
.htaccess changes :- If you not have any htaccess create new and place it on your root.
Go to “application/config/config.php
Find below code

$config[‘uri_protocol’] = ‘AUTO’;
Replace with the below code

$config[‘uri_protocol’] = ‘REQUEST_URI’;
create .htaccess file and save it from ‘.htaccess’

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

2 Responses

Leave a Reply

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

3 × 3 =