How to remove index.php from URL in Codeigniter

This tutorial shows how to remove index.php from URL in Codeigniter. We want to remove the index.php file so that URL looks good and it makes better readability. Also the clean URL is easy to remember.

Before you change anything in comfig.php and .htaccess file make sure you have mod_write enabled in the server ottherwise it won’t work. For localhost you can enable it yourself and for live server if it does not work then you can contact with the hosting company.

<root directory> – is the root directory under htdocs in localhost or public_html(live server)
Check below things in <root directory>/application/config/config.php file

config.php

 

Put the below lines in .htaccess file which is under <root directory>

.httacces

 

That’s all. Thanks for your reading. Please do not forget to leave a comment.

Soumitra

Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

2 thoughts on “How to remove index.php from URL in Codeigniter

  1. I needed to thank you for this great read!! I certainly loved every bit
    of it. I have you bookmarked to look at new stuff you post…

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.