routing problems |
[eluser]lefrog[/eluser]
I cannot seem to get my routing to work as per the user guide: $route['page/:any'] = "page"; I want anything with the first segment equal to page and second segemnt equal to anything to go to page It works if the url is: http://localhost:9017/index.php/page/ but if I add a second segment i.e http://localhost:9017/index.php/page/test/ I get a 404 Am I using the routes config correctly?
[eluser]coolfactor[/eluser]
Do you have an index() function in your Page controller?
[eluser]lefrog[/eluser]
Yes my controller is Code: <?php
[eluser]Unknown[/eluser]
Have you some other routes rules in your routes.php ? I tested your example on my machine and it worked.
[eluser]lefrog[/eluser]
Thanks for responding! Weird that, these are my route rules: Code: $route['page/:any'] = "page"; Like I say it works if I type http://localhost:9017/index.php/page or http://localhost:9017/index.php/page/index but if I type http://localhost:9017/index.php/page/gallery I get a 404. Is there something I'm missing here. Can I route an url with two segments to a just the class 'page'.
[eluser]coolfactor[/eluser]
You should put your custom routes *after* those that were in the file already. "default_controller" and "scaffolding_trigger" should be first, followed by your own. There's a bug in the Router library.
[eluser]lefrog[/eluser]
That works a treat cool! Thanks for the help as I was beginning to get a headache. Code Igniter is a sweet framework, I'm 'mostly' enjoying using it and its making most things a breeze!!! |
Welcome Guest, Not a member yet? Register Sign In |