Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Redirection for SSL only authentication

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Apache: Wrong Mime-Type for php  
Author Message
user2853

External


Since: Jul 02, 2004
Posts: 2



(Msg. 1) Posted: Fri Jul 02, 2004 6:34 am
Post subject: Redirection for SSL only authentication
Archived from groups: alt>apache>configuration (more info?)

Hi,
I'm trying to setup a directory on a webserver that has both port 80 and
443 listening such that certain directories have authentication against an
ldap server but will only do this authentication when the current connection
is SSL. This directory will redirect to the same location with https if it
is accessed with http.

I realise I could easily put a redirect in under the virtual host however
i'm wondering if theres a much more elegant solution along these lines.

I create a .htaccess file in that directory that looks like this:

===
RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://www.somesite.com/secure-directory [R]

<**Some statement that will allow the material below to be called only if
ssl is on for this connection**>
AuthLDAPAuthoritative on
**Various LDAP authentication directives here**
</**Some statement that will allow the material below to be called only if
ssl is on for this connection**>
===

Does anyone know what I could maybe replace <**Some statement that will
allow the material below to be called only if ssl is on for this
connection**> with? I've tried <IfDefine SSL> but that defines true in
general if SSL is loaded at all, not whether the current connection is
secure.

thanks in advance,

---- Alex

 >> Stay informed about: Redirection for SSL only authentication 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Fri Jul 02, 2004 7:59 am
Post subject: Re: Redirection for SSL only authentication [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alexander Cohen <A.Cohen.RemoveThis@latrobe.edu.au> wrote:
 > ldap server but will only do this authentication when the current connection
 > is SSL. This directory will redirect to the same location with https if it
 > is accessed with http.

Use a <Location ...> directive in the http part of the configuration
to redirect to https for every directory you want to protect.

Davide

--
| A rock pile ceases to be a rock pile the moment a single man
| contemplates it, bearing within him the image of a cathedral. --
| Antoine de Saint-Exupery
|<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Redirection for SSL only authentication 
Back to top
Login to vote
user2853

External


Since: Jul 02, 2004
Posts: 2



(Msg. 3) Posted: Fri Jul 02, 2004 8:29 am
Post subject: Re: Redirection for SSL only authentication [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Davide Bianchi" <davideyeahsure.DeleteThis@onlyforfun.net> wrote in message
news:2kk8ebF3c1k7U1@uni-berlin.de...
 > Alexander Cohen <A.Cohen.DeleteThis@latrobe.edu.au> wrote:
  > > ldap server but will only do this authentication when the current
connection
  > > is SSL. This directory will redirect to the same location with https if
it
  > > is accessed with http.
 >
 > Use a <Location ...> directive in the http part of the configuration
 > to redirect to https for every directory you want to protect.

Hi, as I said in my original post I know I can do that, what i'm after is an
elegant solution
that I could throw in a .htaccess file without having to do configuration
additions in more than
one location. This would will hopefully keep putting in multuple ones of
these more manageable.

--- Alex<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Redirection for SSL only authentication 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]