How can I remove index.php from URL in Codeigniter?

Member

braeden

by braeden , in category: Technology , a month ago

How can I remove index.php from URL in Codeigniter?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by kade.hermiston , a month ago

Follow below steps to index.php from URL in Codeigniter

  • Step 1: Open config.php and replaces
1
2
3
$config['index_page'] = "index.php" to $config['index_page'] = "" 
and
$config['uri_protocol'] ="AUTO" to $config['uri_protocol'] = "REQUEST_URI"
  • Step 2: Change your .htaccess file to
1
2
3
RewriteEngine on
RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]