Welcome Guest, Not a member yet? Register   Sign In
uri routing / default controller question
#1

[eluser]Unknown[/eluser]
hi,

i'm trying to setup my urls to look like the following

mysite.com/index.php/foo/news/id
mysite.com/index.php/foo/portfolio
mysite.com/index.php/bar/news/id
mysite.com/index.php/bar/portfolio

where foo and bar are dynamic (they would be checked with a category name in a database). News/Portfolio would be the controller i want to call, and foo/bar would be the 'category' for each controller

i'm assuming i'd have to use the uri routing for this, but i'm pretty stumped at the moment as to how to set it up for this task Sad
#2

[eluser]Phil Sturgeon[/eluser]
Something along the lines of:

Code:
$route[':any/portfolio'] = 'portfolio/category/$1';
$route[':any/news/:num'] = 'news/article/$2/$1';
$route[':any/news'] = 'news/category/$1';




Theme © iAndrew 2016 - Forum software by © MyBB