• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing index.php in CI 3.0

#1
Hi guys,

what is the right codes in .htaccess to remove the index.php in the URL?

I have no problem with CI 2.0 but it seems the codes doesn't work in CI 3.0.

Any help please.

Thanks in advance.
Reply

#2
This works for me:


Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # Remove index.php from URL
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L]
</IfModule>

Also check in your application/config/config.php file that the index_page variable is set to blank:

Code:
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';
Reply

#3
RewriteEngine На
RewriteCond% {} REQUEST_FILENAME! -f
RewriteCond% {} REQUEST_FILENAME! -d
RewriteCond $ 1 ^! (Индекс \ .php | роботы \ .txt | карта сайта \ .xml | CSS | JS)
RewriteRule ^ (. *) $ Index.php / $ 1 [L]
Reply

#4
@jayadra

Thanks dude it is working.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.