Removing index.php from the url in codeigniter

By | May 23, 2014

Eg:how to remove index.php from the below url ?

http://localhost/hello/index.php/usernamevalidation/validateme

after removing the index.php url will be look like as below

http://localhost/hello/usernamevalidation/validateme

For removing the index.php follow the following steps

open the config.php php in config folder make the changes as below
$config[‘index_page’] = “”;
$config[‘uri_protocol’] = “REQUEST_URI”

and create an .htaccess file and add the below code

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

  • of course like your web site but you need to take a look
    at the spelling on quite a few of your posts.

    Many of them are rife with spelling problems and I to find it very troublesome to
    tell tthe truth on the other hand I will certanly come again again.

    • Admin

      Hi

      Thanks I will try to correct all spelling mistakes in the future posts.

      Thanks
      http://mydoubts.in