I am trying to remove index.php in url for Code Igniter. According to the official guide, I have to add the following code to the .htaccess file.
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
This does not work.
So, I make more requests, and some say that I should delete the default configuration on the index page, so I make changes to the config.php file:
$config['index_page'] = '';
It still does not work. Then, on other searches, I found another version of the code, like this one (there is only an example, I have already tried many versions)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
I originally put the code in the .htaccess root directory, but since it does not work, I will also try adding it to the .htaccess in another directory. However, still not working.
, , . .
http://localhost/projectFolder/CodeIgniter/welcome/
- , ?