This post is marked as solved. If you think the information contained on this thread must be part of the
official documentation, please contribute submitting a
pull request to its repository.
Can anyone tell me how can you do a redirect from this event? I cannot do that.
public function beforeNotFoundAction()
Ah, my bad, I haven't realized that I did the wrong question. What I want is to redirect, but before that, use setStatusCode(). The problem is that, even with setNotModified(), the statusCode is deleted.
Phalcon\Http\Response::redirect automatically sets up a 301/302 status code which is the right way to perform a redirection: http://en.wikipedia.org/wiki/HTTP_301
You can pass the status code in the third parameter:
$response->redirect("http://www.example.com/new-location", true, 304);
Ah well, nevermind. I forgotted that I was redirecting, so setting a 404 doesn't makes sense. Thanks.