title: Force HTTP to HTTPS Redirect in Zend Framework
body: <p>Hi currently i bought SSL Certificates from Godaddy and install in on LoadBalancer. I have an zend framework app, but i have the issues with site redirection to Https. Following are my Bootstrap code that i found easiest way to redirect my site to https :</p>
  
  <pre><code> protected function _initForceSSL() {
       if($_SERVER['SERVER_PORT'] != '443') {
        header('Location: https://' . $_SERVER['HTTP_HOST'] . 
                  $_SERVER['REQUEST_URI']);
        exit();
      }
  </code></pre>
  
  <p>Unfortunately server error is return. What am i missing here? Thanks</p>
  
  <p>Update:</p>
  
  <p>.htaccess at root of file</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTPS} on
  RewriteCond %{REQUEST_FILENAME} -s [OR]
  RewriteCond %{REQUEST_FILENAME} -l [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [NC,L]
  RewriteRule ^.*$ public/index.php [NC,L]
  </code></pre>