[ILUG] restricting non https access to a directory

Gavin McCullagh ilug_gmc at fiachra.ucd.ie
Wed Apr 14 21:55:32 IST 2004


On Wed, 14 Apr 2004, bryanhunt at newmailserver.coast-country.com wrote:

> I've got a directory that I don't trust my users to always access using
> https. I want to make it so that it can only be accessed through ssl.
> 
> Is there a quick and dirty directive to do this ? Or do I have to mess
> around with apache perl modules or virtual servers ?

This is the one which squirrelmail includes in it's install:

# redirect to https when available (thanks omen at descolada.dartmouth.edu)
<IfModule mod_rewrite.c>
  <IfModule mod_ssl.c>
    <Location /squirrelmail>
      RewriteEngine on
      RewriteCond %{HTTPS} !=on
      RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI}  [L]
    </Location>
  </IfModule>
</IfModule>



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.linux.ie/pipermail/ilug/attachments/20040414/0f4a9813/attachment.pgp


More information about the ILUG mailing list