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



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



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

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”

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.