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 :
protected function _initForceSSL() {
if($_SERVER['SERVER_PORT'] != '443') {
header('Location: https://' . $_SERVER['HTTP_HOST'] .
$_SERVER['REQUEST_URI']);
exit();
}
Unfortunately server error is return. What am i missing here? Thanks
Update:
.htaccess at root of file
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]
$this->getRequest()->isSecure()should be used to check for secure transport. - Daniel W.