Subject: switching http requests to https

From: [email-masked]
Date: Sat, 27 Jul 2002 19:48:01 -0400

Hi.

I need to be able to transparently (to the user) switch user's http requests
to https. Meaning when the user opens a browser and types
"http://server/resourse" I need to recognize that the request came in as
http and need to instruct the browser to resend it as
"https://server/resourse". Ideally I'd like to accomplish that via some
mod_perl script, but if there is a configuration directive, that would work
too.
I'd appreciate any help regarding how to accomplish this.

thanks a lot,
Sasha Novozhilov
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: Flemming Frandsen <[email-masked]>
Date: Sun, 28 Jul 2002 16:07:04 +0200

[email-masked] wrote:

> "https://server/resourse".

Ah, that's simple, just set the Location header, this is what is known 
as an external redirect and it works nicely for doing what you want:
$r->cgi_header_out("Location", "https://yaddayadda")

HTH

-- 
  Regards Flemming Frandsen - http://dion.swamp.dk
  PartyTicket.Net co founder & Yet Another Perl Hacker

---

From: "Danalien" <[email-masked]>
Date: Sun, 28 Jul 2002 21:37:54 +0200

There is a very simple approach, using the rewrite directive.
(forwarding it a other https server or virtualhost of yours.

I'm actively using:
	redirect / https://www.<domain>.com/

You can put in the-main-conf or in a VirtualHost, 

Example:
(I don't use http, only https, so I've made a VH for http to forward to https)

<VirtualHost <domain-name/or-ip>:80>
	SSLEngine Off
	port 80
	redirect / https://www.<domain>.com/	
	ServerName	www.<domain>.com
	ServerAdmin	<user>@<domain>.com
	ErrorLog logs/dummy-www.<domain>.com-error_log
	CustomLog logs/dummy-www.<domain>.com-access_log common
</VirtualHost>

>I'd appreciate any help regarding how to accomplish this.

//   with regards
//   ID ::  danalien  ::  <[email-masked]>

PGP Public Key Fingerprint: C891 D3A1 427A A5E7  449F B19E 1E85 A109