Welcome Guest, Not a member yet? Register   Sign In
Multiple Urls to one default controller
#1

[eluser]Unknown[/eluser]
I have a newbie question here.
I have a website that right now only has two products and I want one controller to handle all requests for the products.
What I need is for http://localhost/eggs/ or http://localhost/bacon to go to the products controller (function index). Then I can return a different product through my model based on $this->uri->segment(1)

I understand how to do it if I were to use this convention http://localhost/products/eggs but I do not want to add that extra uri segment in there.

Thanks,
Stewy
#2

[eluser]kirkaracha[/eluser]
Have a controller called "products" and use URI Routing to take "products" out of the URL.
#3

[eluser]Unknown[/eluser]
I knew there was a simple way. Thanks for pointing me in the right direction.




Theme © iAndrew 2016 - Forum software by © MyBB