i am using codeigniter 3. i have created a simple controller and when i try to access the controller am getting the 404 error.
my controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class home extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
echo "Working fine";
$this->load->view('comman/header.php');
$this->load->view('home/home.php');
}
}
config file
$config['base_url'] = 'http://localhost/annaiplan/';
$config['index_page'] = 'index.php';
$config['url_suffix'] = '';
.htaccess
Options +FollowSymLinks
RewriteEngine on
RewriteBase /annaiplan
RewriteCond $1 !^(index\\.php|resources|robots\\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
when i try to access the app am getting 404 error.
http://localhost/annaiplan/home/