Welcome Guest, Not a member yet? Register   Sign In
Category as URI segment?
#1

[eluser]Unknown[/eluser]
Hi,

I'm fairly new to CI ( but loving it so far ) and i made this simple site which can show all posts, or a specific post if you click on it.

Now everything is working but when u go to a single post the url looks like this
Code:
site/article/article-name ...

is it possible to have the category name in the uri instead of 'article'

Code:
site/updates/article-name

( where updates is the name of a category )
#2

[eluser]Tpojka[/eluser]
You need to make it display:

Code:
article/updates/article-name

As you can see you need other (in this case first) argument in article controller as your table category.

Than you can avoid first segment with URI routing (check manual) or htaccess. URI routing is much more easier to achieve.




Theme © iAndrew 2016 - Forum software by © MyBB