First, you need to grab the original url for the redirection.
You can do that by the Zend_Controller_Request class via:
$url = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
or simply by:
$url = $_SERVER['REQUEST_URI'];
Then, the tricky part is to pass it through the user request.
I recommend to use the library Zend_Session, despite using a POST parameter is also legitimate:
$session = new Zend_Session_Namespace('Your-Namespace');
$session->redirect = $_SERVER['REQUEST_URI'];
Please note that the address we kept includes the base path.
To redirect the client in the controller class, disable the option 'prependBase' to lose the base path insertion:
$this->_redirect($url, array('prependBase' => false));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…