How To Remove index.php From URL in Codeigniter

It's only fair to share...Share on Facebook0Share on Google+0Tweet about this on Twitter0Share on LinkedIn0Pin on Pinterest0Digg thisShare on StumbleUpon0

Once we install the default Codeigniter 3.0 then by default there is index.php in the URL. So the URL looks like

For SEO point of view we require a clean URL and codeigniter provide easy way to remove index.php for URL rewrite functionality. It can be easily achieve by using .htaccess and few changes in config file.

Follow the steps to remove index.php from URL:

Step 1: Go to “application/config/config.php”
Find below code:-

Replace with the below code:

Step 2:
create htaccess file on your project root location and add following lines

After that your website URL has been cleaned and new URL will be controller/function


  1. By kusum


    • Reply

Leave a Reply

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


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">