CodeIgniter Forums

Full Version: Multiple Urls to one default controller
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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.


El Forum

Have a controller called "products" and use URI Routing to take "products" out of the URL.

El Forum

I knew there was a simple way. Thanks for pointing me in the right direction.