[eluser]Unknown[/eluser]
Edit: nevermind, ill just catch everything with
Code:
$route['(:any)'] = "site";
$route['default_controller'] = "site";
And use uri->segment to see what pages have to be displayed.
---
Hi everyone, I've got a (i hope) simple question for you, why does the following code not work?
My site.php in the controller directory:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Site extends CI_Controller {
function __construct() {
parent::__construct();
}
public function index() {
echo "index";
}
public function subpage() {
echo "subpage";
}
public function newspost() {
echo "newspost";
}
}
?>
My routes file:
Code:
$route[':any/:any/:num'] = "site/newspost";
$route[':any/:any'] = "site/subpage";
$route['default_controller'] = "site";
$route['404_override'] = '';
If i try to go to localhost/mysite/ I see "index", but when i go to localhost/mysite/whatever i get a page not found (a page generated by apache, not CI), but shouldnt it say "subpage"?