如何从zend应用程序重定向到非zend链接

Awa*_*wan 3 php redirect zend-framework forward

我的应用程序混合了简单的PHP网页和zend应用程序.有时我需要从zend应用程序的Action重定向到简单的PHP网页.

例如:

我想重定向example.com/module/controller/actionexample.com/simplephp.php.

我试过header("Location: example.com/simplephp.php");但它不起作用.

谢谢

mjh*_*_ca 9

是的,基本的重定向操作助手允许您重定向到任何URL.

class MyController extends Zend_Controller_Action {
    public function indexAction() {

        $this->_redirect('/path/to/any/page.php');
        // or
        $this->_redirect('http://example.com/anypage.php');
    }
}
Run Code Online (Sandbox Code Playgroud)