Welcome Guest, Not a member yet? Register   Sign In
Classes in 'welcome' handler and URI structure
#1

[eluser]ckelly06[/eluser]
I'm having what I'm guessing is a very basic problem, but I can't figure out the solution. My default controller is 'welcome.php', so that if someone goes to http://mysite.com/ that's the controller that handles the request. I'm trying to add links to some static pages ("Privacy", "Terms", "Contact Us", etc.) and instead of creating a new controller for each of those, I wanted to just create classes off the welcome.php controller that load the views for each of those.

However, when I visited http://mysite.com/privacy/ I got a 404 error. After being confused for about 10 minutes I realized that if I visited http://mysite.com/welcome/privacy the page loads correctly, but the problem is I don't want that 'welcome' in there.

Is there some way to make it so that the default handler's name is effectively 'blank' so that I can construct classes from that handler and link to them without injecting the controller's name into the URL? The only workaround I've found so far is to use the routes.php file to manually point '/privacy/' to 'welcome/privacy/' but that seems like a very bad way to do it.

Thanks in advance!


Messages In This Thread
Classes in 'welcome' handler and URI structure - by El Forum - 09-23-2013, 04:57 PM
Classes in 'welcome' handler and URI structure - by El Forum - 09-23-2013, 07:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB