Weird Router Catchall Problem

View: New views
2 Messages — Rating Filter:   Alert me  

Weird Router Catchall Problem

by TimG-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I am using this:
Router::connect('(?!admin|items|images)(.*)', array
('controller'=>'displays', 'action'=>'index'));

Here is my problem:
If I go here "/books/view/9" it works fine. But... if there is an
error on the page like the style sheet isn't there. It tries to load
whatever was giving me the error and then goes to the catchall page.

So if I go to "/books/view/9" but the file "style.css" is missing it
redirects to "/style.css" and loads the catchall page.

Been messing with it for hours and I'm not sure what to do... an help
would be appreciated!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Weird Router Catchall Problem

by Dr. Loboto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On catch all page action check if URL is valid or at least not too
wrong (like /style.css). If request isn't valid, display error page.

On Nov 2, 10:46 am, TimG <t...@...> wrote:

> I am using this:
> Router::connect('(?!admin|items|images)(.*)', array
> ('controller'=>'displays', 'action'=>'index'));
>
> Here is my problem:
> If I go here "/books/view/9" it works fine. But... if there is an
> error on the page like the style sheet isn't there. It tries to load
> whatever was giving me the error and then goes to the catchall page.
>
> So if I go to "/books/view/9" but the file "style.css" is missing it
> redirects to "/style.css" and loads the catchall page.
>
> Been messing with it for hours and I'm not sure what to do... an help
> would be appreciated!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---