Wednesday, June 24, 2009

Re: Controller redirect function not setting status properly?

Thanks Brian, you made me realize that I was stupidly trying to do
something more complex than I needed to. Basically, I just wanted a
CMS-editable 404 page, but instead of working with AppError I decided
to try this method. I guess I forgot to Keep It Simple, Stupid. ;) I
still want a 404 but I'll do it the proper way instead.

On Jun 24, 9:21 am, brian <bally.z...@gmail.com> wrote:
> You shouldn't be sending a404status if you're redirecting. Doing so
> is confusing because it becomes impossible to know if the the file not
> found was the original requested or the target of theredirect. Maybe
> you want a 301? Have a look here:
>
> http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection
>
>
>
> On Tue, Jun 23, 2009 at 3:40 PM, Jamie<jamie....@gmail.com> wrote:
>
> > OK, so I'm trying to do a simpleredirectin a controller with a404
> > error code. The call looks like this (within a method in my
> > PagesController class):
>
> > $this->redirect('/not-found',404);
>
> > Theredirectworks, but the HTTP header status is 200, not404
> > (according to a 'LiveHTTPHeaders' plugin for Firefox). Am I doing
> > something wrong? Or is this a bug? Or maybe a faulty plugin? Anyone
> > else use theredirectstatus option with success?
>
> > - Jamie
--~--~---------~--~----~------------~-------~--~----~
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: