Welcome Guest, Not a member yet? Register   Sign In
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 post was last modified: 06-19-2015, 11:30 PM by JayAdra.)

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




Theme © iAndrew 2016 - Forum software by © MyBB