Take a look at the mod_rewrite docos. I remember seeing some test to 
see if a file exists (-f operator?). You could parse the URL's path to
infer the physical directory and check to see if an .htaccess file
exists there, and redirect appropriately to the SSL virtual server.

Off the top of my head, a  problem you might encounter is that you'd 
only have access to the virtual path (the URL's path), and not to the 
filesystem path, so you'd have to be very careful to take possible 
aliases into account.

OTOH, if I had that need, I'd probably do something in a mod_perl 
handler (not a content handler, probably in an auth or access handler)
because I'd have full access to the Apache API.

Cheers...                       MZ

> -----Original Message-----
> From: John W. Sopko Jr. [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 04, 2002 10:49
> To: [EMAIL PROTECTED]
> Subject: http to https redirect configuration question
> 
> 
> I am having a difficult time solving the following: I want our
> apache non-secure http:// server to redirect to the secure
> https:// server whenever the non-secure server encounters a
> .htaccess file in any directory? I do not want to redirect entire
> directories or the server itself, only those that contain a
> .htaccess file.
> 
> The standard apache Redirect or RedirctMatch cannot do this
> because the .htaccess file is not typically specified by the
> user. You run into a looping problem if you specify a redirect
> in the .htaccess file itself.
> 
> I was hoping there is some switch at the server level to do this.
> I of course searched all the docs and mailing archives for
> a solution. There is a solution using javascript in the index.html
> file that can do a redirect but this would have to be placed
> in everyone's .index file and there is no guarantee users will
> do this. 
> 
> Any solutions would be appreciated. Thanks.
> 
> -- 
> John W. Sopko Jr.               University of North Carolina
> email: [EMAIL PROTECTED]         Computer Science Dept., CB 3175
> Phone: 919-962-1844             Sitterson Hall; Room 135
> Fax:   919-962-1799             Chapel Hill, NC 27599-3175
> ______________________________________________________________________
> Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
> User Support Mailing List                      [EMAIL PROTECTED]
> Automated List Manager                            [EMAIL PROTECTED]
> 
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to