Search code examples
php.htaccesscodeignitercodeigniter-3url-routing

404 showing index.php removing time in codeigniter


Already working project i will download and up to another server change all thing but show 404 and index.php add to config working

This is my .htacess file below :

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

i try other rewriting code but not working my config file

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

but all time show 404 why locally not working


Solution

  • Your .htaccess file should be like this :

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

    and in your config.php

    /* for server */
    $config['base_url'] = 'http://silhouetteframes.in/';
    
     /* for localhost*/
    $config['base_url'] = 'http://localhost/app_folder/'; 
    $config['index_page'] = '';