i notice that when i run a zend framework app from a server, there are alot of side effects. main issue is where i use urls like
/auth/login
i need to use
$this->baseUrl('/auth/login');
thats simple to fix. but when i use
$request->getRequestUri()
for use in redirects. eg after login, i want to redirect the user back to the prev page, it goes to the wrong place. eg. my app root is "http://localhost/app1", $request->getRequestUri()
will give /app1
. when i try to redirect back, it will goto http://localhost/app1/app1. btw, i am using Zend Server + IIS7 and my app is configured to run from the url stated above. maybe i shld be going to "/" instead. how can i resolve this?
update
this is in my Zend_Form class
// (Zend_Form) Login.php init()
$req = Zend_Controller_Front::getInstance()->getRequest();
$returnUrl = $req->getParam('returnUrl', $req->getRequestUri());
$this->addElement('hidden', 'returnUrl', array(
'value' => $returnUrl
));
// AuthController after login
$returnUrl = urldecode($form->getElement('returnUrl')->getValue());
if (!empty($returnUrl)) {
$this->_helper->getHelper('Redirector')->setGotoUrl($returnUrl);
}