On Mon, Dec 22, 2008 at 2:36 AM, Andre Kolell
<[email protected]> wrote:
>
> I solved the problem regarding redirect_to and SSL by using mod_rewrite to 
> redirect each http-request to https:
>
> NameVirtualHost *:80
>
> <virtualhost *:80>
>        RewriteEngine On
>        RewriteCond %{HTTPS} !=on
>        RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
> </virtualhost>
>
> I'm not sure if this is an adequate solution.


I use a variation of this and have not had any problems with redirect_to:

<VirtualHost IP:80>
    ServerName DOMAIN

    RewriteEngine On
    RewriteRule   /(.*)   https://DOMAIN/$1   [R=permanent]

    CustomLog /dev/null combined
</VirtualHost>

My main purpose for this is not redirect_to but in case the user tries
to go to the site with http:.  But I guess it also solves a problem I
didn't know I had.

The 'RewriteCond %{HTTPS} !=on' is not necessary since you've
specified :80 and port 80 is always HTTP.

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to