-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
  • 34,719
  • 24
  • 185
  • 251
Ravi Mane
  • 1,388
  • 2
  • 17
  • 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
  • 104
  • 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
  • 740
  • 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,388
  • 2
  • 17
  • 24