Solved thread

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.

302 status code after POST

Hi, my form has this action:

<form method="post" action="/index/save">

My indexController looks like this:

public function saveAction() {
     ...
    $this->response->redirect("/statistic");
    $this->view->disable(); 
    return;
    ....

It's all working but the status code of /index/save is "302 Not found". How can I change that?

Thanks!



754

Why did you write $this->view->disable(); after redirect? when you redirect request to other router you execute statisticAction() method.

Do you have this method?



42.1k
Accepted
answer

HTTP status code 302 means Found, i.e. your redirection is causing that. That is normal, even though I specify 303 status on such redirects. What exact issue do you have, or what do you want to achieve with that redirect?