[eluser]Clowerweb[/eluser]
Hello all,
Basically, here's what I'm looking to do:
I'm working with URLs to determine a page (obviously), and have the URLs set up in the following way:
This currently checks the database to see if segment 1 exists in the database as a page slug, and loads the page if so. So far, so good. Note: I'm handling this in the index() method on the main controller and using the following route in routes.php:
Code:
$route['(:any)'] = "index";
Here's the problem though. I also have controllers that need to be handled, such as /admin. Obviously, it's checking the db for a page with a slug "admin", and not finding it (which it shouldn't). What I need it to do is this:
Check db, if slug exists, load page from db;
If slug does not exist in db, check if there's a controller for it and load that instead (using CI's default handling of controller/function in URI);
Else load 404.
I suspect that there's a way to do this using _remap(), but I don't really understand how it works or what I need to do to get it going.
Thanks for any and all help and suggestions!