Remove “index.php” in codeigniter’s Url path


Do you want to replace http://localhost/code/index.php/welcome/ to http://localhost/code/welcome/

So simple. Follow the rules below.

Create  .htaccess file in root directory.

‘code’ is root directory

gedit code/.htaccess

And then add the below rules to that.

RewriteEngine on
 RewriteCond $1 !^(index\.php|resources|robots\.txt)
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php/$1 [L,QSA]

http://localhost/code/welcome/

Done 🙂

Advertisements

About sathia

Web developer at cloudmint
This entry was posted in Web and tagged , , , , , , , , . Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s