Re: Routing with slugs.

2009-08-19 Thread Taff
Thanks for your help. On Aug 18, 2:32 pm, Martin Westin martin.westin...@gmail.com wrote: You should be alright with something like: Router::connect('/optimised_category_name/*', array('controller' = 'controller_from_cake', 'action' = 'view')); Anything beginning with desired controller

Routing with slugs.

2009-08-18 Thread Taff
After reading through http://book.cakephp.org/view/46/Routes-Configuration along with http://c7y.phparch.com/c/entry/1/art,cake-seo and pottering around for quite some time, I have come to the conclusion that I need some help. Here is the scenario: I am rerouting a controllername to a different

Re: Routing with slugs.

2009-08-18 Thread Martin Westin
if you are going for slugs with the controller prefixed (/consulting/ some_slug_of_mine) and not application-global slugs (/ a_globally_unique_slug) then you don't really have to do anything to the routing settings. I have just gone from a controller with: function view($id) { $this-data =

Re: Routing with slugs.

2009-08-18 Thread Martin Westin
I should also say that the routing bit is useful as a first line of defence against bad slugs. On Aug 18, 12:46 pm, Taff taff.law...@googlemail.com wrote: After reading throughhttp://book.cakephp.org/view/46/Routes-Configuration along withhttp://c7y.phparch.com/c/entry/1/art,cake-seoand

Re: Routing with slugs.

2009-08-18 Thread Taff
Hey Martin, thanks for the reply. That is currently how I have it working. My intention is to do away with the view part of the URL to all intensive purposes so that an call to controller/slug actually reroutes to controller/view/slug The other issue was that I have rerouted my controller

Re: Routing with slugs.

2009-08-18 Thread Martin Westin
You should be alright with something like: Router::connect('/optimised_category_name/*', array('controller' = 'controller_from_cake', 'action' = 'view')); Anything beginning with desired controller name is routed to the view action. You would also need to add specific routes (above that one)