I'm experimenting with SEO friendly URL's in CakePHP as efficiently as I can, I've managed to use the current format, each example uses function view($slug) except for the first example which uses function index().
/categories/
/categories/books/
/categories/books/it-and-computing/
But what if IT & Computing has a sub-category "Web Development"? I'd like the URL to become:
/categories/books/it-and-computing/web-development/
I'm not sure how to do this without creating too many routes. Here is my route code so far:
Router::connect('/categories/', array('controller' => 'categories', 'action' => 'index'));
Router::connect('/categories/:slug', array('controller' => 'categories', 'action' => 'view'), array('pass' => array('slug')) );
Router::connect('/categories/:parent/:slug', array('controller' => 'categories', 'action' => 'view'), array('pass' => array('parent', 'slug')) );
Any help would be greatly appreciated
Kind Regards
Stephen