Remove Index.php From URL CodeIgniter

Create the .htaccess file add the code given below and put it into your root directory of the main folder

And please keep this variable $config[‘index_page’] = ‘ ‘;  empty you can find this in config.php in config folder

RewriteEngine On
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|public|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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

Blog at WordPress.com.

Up ↑

playwithlifeorg

4 out of 5 dentists recommend this WordPress.com site

Crafsol Technology Solutions

Crafting Enterprise Services

Rahul Rajoria

Sr. Software Developer

%d bloggers like this: