php - Codeigniter: All pages shows 404 page not found (codeigniter's 404, not apache's) -


recently, before pc changed hard disk, using virtual host. after changed hard disk, using apache's htdocs folder. when tried accessing codeigniter project again, pages show '404 page not found'. not web server because can tell error message codeigniter's(because styled 404 error page).

my project has 2 controllers: (admin.php , vendor.php). these 2 working fine.

things tried:

  • checked config/config.php

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

    then tried changing to:

    $config['base_url'] = 'http://localhost/work%20projects/admin_panel/'; 
  • tried accessing controllers , without index.php in case mod_rewrite not functioning. still not working.

    http://localhost/work%20projects/admin_panel/index.php/admin http://localhost/work%20projects/admin_panel/admin 

change this

in config.php

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

.htacess

<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l]  </ifmodule> 

note: in pc having same problem. when upload server working perfectly.

so till use

$config['base_url'] = 'http://localhost/work%20projects/admin_panel/index.php/'; 

when uploading remove , run works perfectly.

$config['base_url'] = ''; 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -