Friday, November 13
Trending
- Microsoft 365 Outage: Outlook, Teams and Copilot Down. What We Know
- Diwali Online Shopping Scams 2026: 10 Ways to Stay Safe
- 10 Best DDoS Protection Services for 2027
- 12 Best Web Application Firewalls (WAF) for 2027
- Best Ethical Hacking Tools in 2027: Free & Paid Picks
- Software supply chain attacks 2026: Timeline and developer checklist
- Binance Hack: $6.3 Billion Drained in the Largest Crypto Theft Ever. What We Know So Far
- This Site Uses XSLT Chrome Warning Explained: How to Fix It
CodeIgniter 3 displays index.php in the URL by default. You can remove it by using an .htaccess file to create cleaner, SEO-friendly URLs.
Steps to Remove index.php:
Update the .htaccess File
Create or update the .htaccess file in your CodeIgniter project’s root directory. Add the following code:
Remove index.php from URL in CodeIgniter using .htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Update the config.php File
Edit the application/config/config.php file in your CodeIgniter project and update the index_page configuration:
$config['index_page'] = '';
Example
Before Removing index.php:
URL:http://localhost/infovistar/index.php/Welcome/about_us
After Removing index.php:
URL:http://localhost/infovistar/Welcome/about_us
Testing
Visit your CodeIgniter routes in the browser without the index.php. If it works, you have successfully removed index.php from the URL.
This will ensure clean and user-friendly URLs for your CodeIgniter 3 application!



