.

.

CodeIgniter object not found only the index function works

I have setup the config.php, autoload.php and routes.php as expected.
on the config.php
$config['base_url'] = 'http://localhost/ci';
$config['index_page'] = '';
on the autoload.php
$autoload['helper'] = array('form','url');
on the routes.php
$route['default_controller'] = "site";
I have a controller named site
<?php

    class Site extends CI_Controller{

        function index(){
            $this->load->view('home');
        }

        function new_method(){
            $this->load->view('home2');
        }
    }
?>
The index() loads, as results U get a button and a link but when I click I am given Object not found! Error 404
Solution :  
accepted
  1. make this empty $config['base_url'] = '';
  2. Check .htaccess in root folder with index.php file
  3. Check mod_rewrite apache module is enabled
    RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]
 
 


EmoticonEmoticon