![]() |
routes help - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: routes help (/showthread.php?tid=13094) Pages:
1
2
|
routes help - El Forum - 11-10-2008 [eluser]dippy[/eluser] First off, hello everyone. i am new here. I need a little help here. i need to have a url with a dash in it for SEO. I have been going over the documentation and see i can use the routes.php to re route the page. here is what i got, but its not working. Code: $route['solutions/hpprinters'] = "solutions/hp-printers"; i get this error: " 404 Page Not Found The page you requested was not found. " Even when i go to this url: 'solutions/hpprinters' i get a 404 too? but if i take the route out of the routes.php file i can then see 'solutions/hpprinters' fine. am i forgetting something here? i even changed the uri_protocol setting in config.php to REQUEST_URI Any ideas? Thanks in advance. routes help - El Forum - 11-10-2008 [eluser]Colin Williams[/eluser] I think you need to reverse it. The $route indeces are the route, the values are the application paths (an application path won't ever have dashes). Code: $route['solutions/hp-printers'] = 'solutions/hpprinters'; routes help - El Forum - 11-11-2008 [eluser]dippy[/eluser] [quote author="Colin Williams" date="1226401754"]I think you need to reverse it. The $route indeces are the route, the values are the application paths (an application path won't ever have dashes). Code: $route['solutions/hp-printers'] = 'solutions/hpprinters'; awesome thank you i will try this. Thanks! routes help - El Forum - 08-12-2009 [eluser]dippy[/eluser] I am having another routes problem. i have the following code in my route config file: Code: $route['services/:any'] = "services/section"; is there a way to have the below work if the above code is also in the config file? Code: $route['services/search/:any'] = "services/search"; it wasnt working it kept bringing me to services/section when i tried to do services/search/19428 ... this is what i am trying to accomplish. services/carwash (services/section) the above will show the landing page for that specific service. services/carwash/19428 (services/section/search) and this will search in the database under section carwash and search for zipcode 19428. Any help would be great with my route issue! thanks a bunch! routes help - El Forum - 08-12-2009 [eluser]Johan André[/eluser] should'nt it be (:any) instead of :any? routes help - El Forum - 08-12-2009 [eluser]Dam1an[/eluser] [quote author="Johan André" date="1250123759"]should'nt it be (:any) instead of :any?[/quote] AFAIK, :any will match the route, but you need the brackets if you want to pass that value into the re-routed route (but can still use the segment(n) and rsegment(n) methods if you don't pass the reroute value into the function) routes help - El Forum - 08-12-2009 [eluser]dippy[/eluser] thanks for the info fellas i will try the above... routes help - El Forum - 08-13-2009 [eluser]Johan André[/eluser] [quote author="Dam1an" date="1250124238"][quote author="Johan André" date="1250123759"]should'nt it be (:any) instead of :any?[/quote] AFAIK, :any will match the route, but you need the brackets if you want to pass that value into the re-routed route (but can still use the segment(n) and rsegment(n) methods if you don't pass the reroute value into the function)[/quote] ahh! i did'nt know that... ![]() routes help - El Forum - 10-26-2009 [eluser]dippy[/eluser] I have the following in my routes: Code: $route['services/:any'] = "services/section"; and then i also want to have a url like the following: 'services/towing/company-name' - and have that route to another function in the services controller to pull that's company info. can this be done? when i tried to do this all i kept getting was the section. so i added this for a temp. solution. Code: $route['search/:any'] = "services/search"; but id like to have it under services/section in the url. any suggestions? routes help - El Forum - 10-27-2009 [eluser]dippy[/eluser] Any help on this? |