开发者

Zend redirect problem

开发者 https://www.devze.com 2022-12-30 21:18 出处:网络
I\'m trying to redirect to http://localhost/site/public/admin/login from http://localhost/site/public but for some reason, it keeps redirecting to

I'm trying to redirect to

http://localhost/site/public/admin/login

from

http://localhost/site/public

but for some reason, it keeps redirecting to

http://localhost/admin/login

The code I am using is:

$this->_response->setRedirect('/a开发者_开发问答dmin/login')->sendResponse(); 

This is really frustrating me, and any help would be grealy appreciated


try this :

$this->_response->setRedirect('admin/login')->sendResponse();


For those who stumble upon this problem. this might help. actually encountered this same problem and found this and it worked for me.Cheers

  • Zend and .htaccess


I'm assuming this is within a controller context.

If so, use the Redirector helper

return $this->_helper->redirector('login', 'admin');
0

精彩评论

暂无评论...
验证码 换一张
取 消