Browse By

How to remove index.php from URL in CodeIgniter framework on Windows Xampp

These below steps will help you to remove index.php in CodeIgniter framework using .htaccess.


Open the file config.php located in application/config path. Find and replace the below code.
// Find the below code
$config['index_page'] = "index.php"
// Remove index.php
$config['index_page'] = ""


Go to your CodeIgniter folder and create a .htaccess file.

Path: Your_website_folder/application/assets/system/user_guide/.htaccess


Add the below code in .htaccess file. Before this make sure you have mod_rewrite is enabled.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]


In some cases the default setting for uri_protocol does not work properly. To solve this issue just open the file config.php located in application/config and then find and replace the code as:

// Find this line
$config['uri_protocol'] = "AUTO"
// Change it to
$config['uri_protocol'] = "REQUEST_URI"

Now your setup is complete. Access this url “http://localhost/ci/welcome” for a test run. You should be able to access this without index.php in url.

Latest Posts