Search code examples
phpcodeigniterwampteamviewer

codeigniter url causing error in removing index.php


i have posted question yesterday about removing index dot php from codeigniter path but problem not solved... so can any one come on to team viewer and solve my problem...? thanks in anticipation

my .htaccess in root folder

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Solution

  • You have to move your .htaccess file to that directory where index.php exists and remove it from application directory if exists.

    Then paste following code in .htaccess file.

    <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>
    

    I assume you already perform the other steps which includes turn on the rewrite engine in WAMP and in config.php

    $config['index_page'] = 'index.php';
    

    to

    $config['index_page'] = '';
    

    Also set

    $config['uri_protocol'] = 'REQUEST_URI';
    

    I hope it helps.