php - Codeigniter cannot find controller -


i using codeigniter 3. when running on local wamp server, good. but, when running on vps (linux debian apache 2.2.22) 'url not found' message.

here controller:

<?php defined('basepath') or exit('no direct script access allowed');      class contact extends ci_controller {       public function __construct()       {         parent::__construct();         $this->load->helper('url');         $this->load->library('session');         $this->load->helper('form');     }      public function index()     {       $this->load->view('contact_view');     }   } 

my url controller www.example.com/contact

error message is:

the requested url /index.php/contact not found on server.

i have removed index.php $config['index_page'] = ''

in .htaccess file, using rewrite eleminite need index.php in urls, using this:

rewriteengine on rewritecond $1 !^(index\.php|resources|robots\.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l,qsa]

the directives on virtual host are:
<directory "/var/www/example"> options indexes followsymlinks allowoverride order allow,deny allow </directory>

mod_rewrite enabled on virtual host.

everything works fine on local machine, running wampserver, why not work on vps?

for codeigniter 3, had capitalize first letter of controller filename. example, changed main.php main.php , fixed me.

note did not have on localhost windows laptop, had on hostgator unix server.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -