-1

I tried to remove index.php from url. I tried more links from linkden but have not worked. I tried following.

1.add .htaccess file with following data,

 RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php/$0 [PT,L]

2.changed in config.php $config['index_page'] = '';

3.activate mod_rewrite.

But still not working.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ravi Mane
  • 1,468
  • 2
  • 18
  • 24

3 Answers3

1

Make .htaccess file in root of project directory with following contents:

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

modify application/config/config.php with following:

 $config['index_page'] = '';
Akash
  • 114
  • 8
0

Please replace your htaccess code

RewriteEngine on 
RewriteBase /yourfolder/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond $1 !^(index\.php|js|img|css|captcha|robots\.txt) 
RewriteRule ^(.*)$ /yourfolder/index.php/$1 [L] 
Arun
  • 750
  • 5
  • 12
0

Finally the Following code works in .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Ravi Mane
  • 1,468
  • 2
  • 18
  • 24