Using .htaccess to force https on all requests in Zend MVC

Posted by davykiash on Stack Overflow See other posts from Stack Overflow or by davykiash
Published on 2010-04-26T15:21:04Z Indexed on 2010/04/26 15:23 UTC
Read the original article Hit count: 251

Filed under:
|
|

I have been battling with .htaccess to get all the requests to use https on my Zend MVC. What am seeing is that SSL turns "on" and then goes "off" as the page loads.

Below is my .htaccess file.

SetEnv APPLICATION_ENV production

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

What do I need to adjust to get my https working properly?

© Stack Overflow or respective owner

Related posts about zend

Related posts about url-rewriting