I have a fresh install of codeigniter. I am simply trying to use a function in my default controller like this:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$data = array(
'title' => 'Welcome',
'description' => 'Welcome Page'
);
$this->load->view('layouts/header',$data);
$this->load->view('home/home');
$this->load->view('layouts/footer',$data);
}
public function contact()
{
$data = array(
'title' => 'Contact Us',
'description' => 'Contact Page'
);
$this->load->view('layouts/header',$data);
$this->load->view('home/contact');
$this->load->view('layouts/footer',$data);
}
}
I have removed index.php successfully using htaccess. Now when I go to example.com/welcome/contact it works, but not example.com/contact/.
Why is this, shouldn't this work by default without using routes?