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

Member

by braeden , in category: Technology , 4 years ago

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

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by kade.hermiston , 4 years 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]



Related Threads:

What Are the Key Features That Make Codeigniter Ideal for Rapid Php Application Development?
What is the default URL pattern used in Codeigniter framework?
How to Maintain a Propane Grill to Last Longer in 2025?
Can I Track Clicks with a Url Shortener in 2025?
What to Look for in a Whole-house Water Filter System?
What Are the Best Practices for Coding in React.js?