On Fri, Jul 20, 2012 at 11:23 PM, elogic <asymonds@elogicmedia.com.au> wrote:
> Hello,
>
> I am having some issues with my routes, I have put in the below route so I
> can have my front end pages all go to my contents controller view page.
> e.g. /home shows /contents/view/home or /about-us shows
> /contents/view/about-us (I'm using a slug)
>
> Router::connect('/*', array('controller' => 'contents', 'action' =>
> 'view'));
>
> This works as needed for that part however now all of my other controller
> links are routing to the same area.
>
> e.g. /admin/users/login or /users/index etc all go to the contents/view
> controller / action.
>
> How can I get around this so both items work?
>
Put that rule at the end of the route file so that it catches anything
that hasn't already been defined. Think of it like a sieve with
smaller holes the further down you get. Any specific rule only stops
things that match it exactly whereas regex rules catch more things.
To recap, put the specific rules at the top and less specific rules
further down to make it work properly.
Mike.
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Saturday, July 21, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment