This is one way which perfectly worked to remove index.php from CI URLs for me. I found this on this link.

1.  .htaccess file

create a .htaccess file and put this in codeigniter root folder.

2. write the following code in this file:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /ci

#Removes access to the system folder by users.

#Additionally this will allow you to create a System.php controller,

#previously this would not have been possible.

#‘system’ can be replaced if you have renamed your system folder.

RewriteCond %{REQUEST_URI} ^system.*

RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,

#such as an image or css document, if this More >