My current urls look like this [mysite]index.php/[rest of the slug]
.
I want to strip index.php
from these urls.
mod_rewrite
Only three steps are require to remove index.php from url in Codeigniter
1) Create .htacess file in parallel to application holder and just copy past the following code:
RewriteEngine On
RewriteBase /CodeIgniter/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
2) Change $config['index_page'] to blank in config.php in application folder as below:
$config['index_page'] = '';
3) Enable “rewrite_module” of apache.
Restart your apache and its done.
Details : http://sforsuresh.in/removing-index-php-from-url-of-codeigniter-in-wamp/
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
use
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]
if you have url in this order site.com/index.php/class/method/id
NB:remove index.php in config.php should be config[index_page] = ""
NB: notice the difference at the last line instead of $0 use $1
try this RewriteEngine On
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
if all the above solution not work then in your project folder their will be two files index.html and index.php, rename index.html to index_1.html and browse your project.
Both development and production
# Development
RewriteEngine On
RewriteBase /your_local_folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|scripts|styles|vendor|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
#Production PHP5 CGI mode
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|scripts|styles|vendor|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
first of all you have to on the apache server rewrite engine on.this link will help you for that
http://www.anmsaiful.net/blog/php/enable-apache-rewrite-module.html
RewriteEngine On
RewriteBase /your_folder_name/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
this will be your .htaccess file. now try it .this setting works for me.