I am trying to remove the index.php in the url for Code Igniter. According to the official guide, I should add the following code to the .htaccess file.
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
This is not working.
So I do more searches and some say that I should remove the default configuration on the index page, so I make the changes in the config.php file:
$config['index_page'] = '';
It is still not working. Then, on more searches, I found different version of the code, like this one (there is just an example, I have tried many version already)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
I initially put the code in the .htaccess of the root directory, but as it is not working, I also try adding it to .htaccess in other directory. Yet, still not working.
I am just using the default welcome page for testing, so I am sure it is not the problem of coding. i.e.
http://localhost/projectFolder/CodeIgniter/welcome/
Anybody got idea what have I missed?