Home > Article > Backend Development > How to Remove \'index.php\' from CodeIgniter 2.0 URLs?
Removing "index.php" from URLs in CodeIgniter 2.0
Issue:
Many users encounter difficulties removing the "index.php" segment from their CodeIgniter 2 URLs. Previous solutions used in CodeIgniter 1.7 no longer suffice.
Troubleshooting Steps:
1. Rewrite Rules:
RewriteEngine On RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/ [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/ [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/ [L]
2. URI Protocol and Index Page:
3. File Structure:
4. .htaccess Optimization:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/(site)/ [L]
5. Change Path Separator:
6. Contact Support:
The above is the detailed content of How to Remove \'index.php\' from CodeIgniter 2.0 URLs?. For more information, please follow other related articles on the PHP Chinese website!