httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: [users@httpd] http redirection to httpd
Date Fri, 06 Nov 2009 00:23:53 GMT
sangfroid wrote:
>  Hi John,
> 
> Thank you for the reply. I also found one more way to do it ...
> 
> Added the following directive in httpd.conf
> 
> 
> <Location /private>
>    RewriteEngine On
>    ReWriteCond %{HTTPS} !=on
>    RewriteRule .* https://%{HTTP_HOST}:443%{REQUEST_URI} [QSA,R=permanent,L]
> </Location>
> 
> However, now the problem is, I also needed the users to authenticate by
> htaccess file. But keeping .htaccess file in /var/www/html/private is not
> working. I mean in that case, first the system asks password in an unsecured
> mechanism and then only https redirection is working. I wanted just the
> reverse...first establish secure connection and then  only ask the user for
> password...
> 
> Any clue on it ?? 
> 
Then you will probably have to create 2 VirtualHost, and place your 
authentication in the HTTPS host.

Listen *:80
Listen *:443
...
<VirtualHost *:80>
   your HTTP host config
</VirtualHost>
<VirtualHost *:443>
   your HTTPS host config

  <Location />
   AuthType Basic
   AuthName private
   ...
  </Location>

</VirtualHost>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message