title: Zend Framework 1 force HTTPS
body: <p>How can I force HTTPS using Zend Framework 1, <code>Zend_View_Helper_Url</code> and the request object?</p>
  
  <p>I got this but am looking for a ZF1 way without concatting _SERVER variables...</p>
  
  <pre><code>if (!$this-&gt;getRequest()-&gt;isSecure()) {
      $this-&gt;redirect(
          'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']
      );
  }
  </code></pre>
  
  <p>Please don't suggest <code>.htaccess</code> solutions. There are too many questions asking for Zend code answered with mod_rewrite suggestions.</p>
  
  <p>I know you can pass <code>options</code> to the URL/redirect helper but I'm not sure how it's done.</p>
  
  <p>Pseudocode:</p>
  
  <pre><code>$this-&gt;redirect(array('useHttps' =&gt; true), $this-&gt;getRequest()-&gt;getRequestUri());
  </code></pre>