Sunday, July 25, 2010

Re: Object Not Found : Cake 1.3

On Sun, Jul 25, 2010 at 5:43 AM, parag <parag.shar@gmail.com> wrote:
> I have created a UsersController inside users_controller.php, along
> with User class as a model in user.php.
>
> My Routes config file is
>
>        Router::connect('/', array('controller' => 'users', 'action'
> => 'login'));

I don't think it's a good idea to set your base URL to a login screen.
What I've done in the past is:

Router::connect('/', array('controller' => 'pages', 'action' =>
'display', 'home'));

Then, in PagesController, don't bother adding $this->Auth->allow() so
every URL will be protected.

>        Router::connect('/pages/*', array('controller' => 'pages', 'action'
> => 'display'));
>
> I created another action named 'login' inside my UsersController
> class.
>
> I try to invoke the URL : http://sitename/users/login, and it gives me
> a 404 Error, not the cake error like controller, or action not found.
>
> What I simply get is a default 404 error of browser, which says Object
> Not Found on Server.
>
> However I get the right page when using just the base url , i.e, only
> upto http://sitename/
>
> How could this be? I am using Cake 1.3.

Odd. Do you have debug set to 0? If so, raise it to 2.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

No comments: