My current urls look like this [mysite]index.php/[rest of the slug]
.
I want to strip index.php
from these urls.
mod_rewrite
you can go to application\config\config.php file and remove index.php
$config['index_page'] = 'index.php'; // delete index.php
Change to
$config['index_page'] = '';
Note the difference with the added "?" character after ".php", especially when dealing with CodeIgniter:
RewriteRule ^(.*)$ index.php/$1 [L]
vs.
RewriteRule ^(.*)$ index.php?/$1 [L]
It depends on several other things.. if doesn't work, try the other option!
on your htaccess use this,
RewriteEngine On
RewriteBase /root_folder_name/
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Hope this helps.
1.Create a new file .htaccess on root directory.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>`
2. Go to your config.php file and change from $config['index_page'] = 'index.php'
to $config['index_page'] = ''
Solved it with 2 steps.
- Update 2 parameters in the config file application/config/config.php
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
- Update the file .htaccess in the root folder
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
you can go to config\config.php file and remove index.php value from this variable
$config['index_page'] = 'index.php'; // delete index.php
create .htaccess file and paste this code in it.
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
#Send request via index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
good chance