PHP / Programmings

Remove index.php from CodeIgniter url

By default, the index.php file will be included in your URLs. You can easily remove this file by using a .htaccess file with some simple rules.

To remove index.php from codeigniter url follow the steps,

  1. Create .htaccess file on the root folder (in project folder).
  2. Add the following rule to that .htaccess file.
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]  

    Then save the file. Refresh url without index.php .


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s