You could do it on a few levels - really depends on your setup (and if you need dynamic subdomains, etc). But yes, using .htaccess (or inside httpd.ini) would be your fastest options.
Cheers, Adam ----- Original Message ----- From: <[email protected]> To: "CakePHP" <[email protected]> Sent: Tuesday, June 23, 2009 11:19 PM Subject: Re: n-categories URL routing one more question:) is it possible to route subdomains as well such easy way? :) let say that we rout ... subdomain.example.com.... to index of a specific controller... OR this is done in httpd.ini ?? Thanks Tomas On Jun 23, 2:26 pm, "[email protected]" <[email protected]> wrote: > Hi Adam, > thanks a lot, I did not realize that it is so easy... I have already > try it and it is working. :) > anyway good point with the whole path... > > Tomas > > On Jun 23, 12:45 pm, "Adam Royle" <[email protected]> wrote: > > > Setup a route like this: > > > Router::connect('/categories/*', array('controller' => 'categories', > > 'action' => 'index')); > > > Then in your index() method of CategoriesController you can then check > > for > > the additional params in $this->params... > > > This is not so dissimilar how Cake's PagesController works. > > > I do something like this, however I store the entire path (eg > > "slug1/slug2") > > in the database, since you might have duplicate identifiers like so: > > > /categories/sony/video-cameras/ > > /categories/philips/video-cameras/ > > > Cheers, > > Adam > > > ----- Original Message ----- > > From: <[email protected]> > > To: "CakePHP" <[email protected]> > > Sent: Tuesday, June 23, 2009 8:20 PM > > Subject: n-categories URL routing > > > > Hi, > > > I it possible to make such a URL routing in cake? > > > > subdomain.example.com/categories/category1/category2/category-n > > > > I am wondering whether is possible to specify an URL relatively for N- > > > levels of nested sub-categories... > > > > imagine you have e.g. eshop with following structure: > > > > *Electronics > > > *****Computers > > > ********Accesories > > > > So the following url would look like > > > - Electronics/Computers/Accesories > > > > for accessing accesories I need only accesories slug or ID - and it > > > already knows its parents in the tree representation. How can I > > > relatively specify in router that everything in-between categories and > > > category-n (******) > > > is ignored?? or in other words, how to extract only the last items > > > which is the identifier?? > > > > myshop.example.com/categories/******/******/******/******/identifier- > > > slug > > > > I have found very nice real example: > > >http://www.mujmultimarket.cz/kategorie/elektronika/audio-video/audios... > > > > Thanks!! Tomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
