The ViewHelper URL only collects paths that are absolute on behalf of the host. so you need to explicitly specify the https link prefix
<? $url = $view->url(array('some' => 'params') ) ?>
<a href="https://<?= $_SERVER['HTTP_HOST] ?><?= $url ?>">my explicit https link</a>
you should create your own small viewhelper that does this for you, and also checks if HTTP_HOST, etc. is set, maybe you also take it from config instead of $ _SERVER.
$ view-> httpsUrl (array ('some' => 'params') /, $ route, $ reset /);
, reqeust https, , , otehr.
:
My_Controller_Plugin_HttpBlacklist extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
if (($request->getModuleName() == 'foo' &&
$request->getControllerName() == 'bar' &&
$request->getControllerName() == 'baz')
) {
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') {
header('Location: https://'. $_SERVER['HTTP_HOST] . $_SERVER['REQUEST_URI']);
exit;
}
}
}
}
$frontController- > registerPlugin ( My_Controller_Plugin_HttpBlacklist);