• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to extend the Default Controller

I have a question in regards to extending the default controller value/variable in the route configuration.

I would like to keep my URL clean as possible. When a user comes to the home page and look at all the front end/public pages, I want to have 1 controller called FrontEnd (or Public). So the home page of the site will have this in the URL:


If I want to have a contact, support, and about pages, I would like to have the URL look like this:

http://www.example.com/contact OR
http://www.example.com/support OR

But as far as I can tell, it seems I have to create a controller for each one of these separate pages even though they should belong in the FrontEnd/Public controller.

Does this make sense? Is this possible with CI? I would like the default controller value in the route configuration to allows be called... and in my case... look in that default controller to see if that method exists, if not, assume its a controller. (and if that controller doesn't exist, its a 404 page)

I appreciate any help on this, thank you in advance.

[eluser]Michael Wales[/eluser]
Look into URI Routing.


Thank you for the quick reply and help. I got it working on my first effort, thanks again.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.