views:

603

answers:

2

I am using Zend Framework(MVC part of it), and need to either redirect user to SSL enabled page or to force SSL from controller somehow and don't quite see how to do that? Maybe someone can share the knowledge?

Thanks!

+4  A: 

It's easy to do at the web server level.

In Apache, you'd do it like this:

RewriteEngine On
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
bigmattyh
+1  A: 

Take a look at the PHP header manpage, specifically this user contribution regarding https handling and redirection.

Brian C. Lane