On 8 Mar 2003 at 6:45, Nick Tonkin wrote:

> On Sat, 8 Mar 2003 [EMAIL PROTECTED] wrote:
> 
> > Hi -
> >
> > I'm not much of a mod_perl scripter (yet), but having been
> > totally defeated my mod_rewrite, I am trying to use mod_perl
> > to push clients into using https when accessing a particular
> > server (I am using named-based virtual hosting).
> > [...]
> 
> I _just_ went through this on my system. You would probably want to use
> the following to change the URI as you wish:
> 
>     my $uri = APR::URI->parse($r->pool, $r->construct_url);
>     $uri->scheme('https');
>     my $new_uri = $uri->unparse;
> 
> However, the overall strategy is probably not what you want, due to the
> way SSL works. When a browser requests a secure connection, the SSL
> connection (to the secure port) is established _before_ even the HTTP
> connection. Thus it is impossible to change the scheme (http vs https)
> once you have arrived at your server. The only way to do this with a Perl
> handler is to generate a 302 external redirect.
> 
> mod_rewrite can be complicated, sure, but I do think it's the way to
> go in this situation. You need:
> [...] 
> ~~~~~~~~~~~~~~~~~~~~
> Nick Tonkin   {|8^)>
> 

Thank you Nick for your detailed and informative reply! Back to mod_rewrite ;)
I'll see if I can get thru the virtual host/mod_rewrite maze...and
let you know.

Thanks and Aloha => Beau;



Reply via email to