I'm having trouble making the page load the controller I want it too.
For example I want my site to load as localhost/sitename/catergory1/catergory2 where catergory 1 is its own controller and 2 is a method. So i've tried adding this to my routes.php:
$route['catergory1'] = 'catergory1/cat1';
with my controller file set up as:
-Controller
-Home.php
-catergory1
<- subfolder
-cat1.php
which I thought would cause codeigniter to load the controller 'cat1' inside the catergory 1 folder but instead when I go to localhost/sitename/catergory1 it just loads my default controller 'home'. I've tried putting it in both the uri routes and reserved routes part of routes.php but it still won't work. It's probably something really easy but im new to this.
Heres the controllers themselves just incase its something to do with them:
home controller:
class Home extends CI_Controller {
function index() {
$this->load->view('home');
}
}
Cat1 controller:
class Cat1 extends CI_Controller{
function index() {
$this->load->view('cat1');
}
}
Am i just being stupid and missing something easy?
Thanks.