LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-07-2004, 04:13 AM   #1
abapdr
LQ Newbie
 
Registered: May 2004
Posts: 10

Rep: Reputation: 0
Question Force https on a password protected directory


Hi Gurus,

I would like to setup a directory on my site, where the users would have to login with a password as well as use https only.
This is what I have done so far:

httpd.conf
Code:
<Directory "/usr/local/apache2/htdocs/secure">
  RewriteEngine  on
  RewriteCond %{SERVER_PORT} !^443$
  RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  AuthType  Basic
  AuthName  "Restricted"
  AuthUserFile  /usr/local/apache2/passwd/passwords
  Require  valid-user
</Directory>
This seems to do the job with one big problem: it asks for the password twice (one for the original http and then one for the https I guess).
What am I doing wrong here? Any help is much appreciated.
abapdr
 
Old 06-07-2004, 04:35 AM   #2
overlord73
Member
 
Registered: Apr 2004
Location: ..where no life dwells..
Posts: 541

Rep: Reputation: 30
Hi!

I think i had the same prob on my old RH9-box one year ago.

an alternative is using a php-script like this instead of a link:

<?php
header ('Pragma: no-cache');
header("Location: https://host.domain.tld");
exit();
?>


at the moment i don´t know, but when i´m at home i´ll try and come back...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Password Protected Folder's vezril Linux - Security 2 06-06-2005 11:26 PM
Password protected Apache ne21 Linux - Software 5 07-30-2004 01:08 AM
password protected directories dsgdevil Linux - General 1 02-17-2003 12:02 AM
Password Protected Directories TheSockMonster Linux - Security 2 05-31-2002 04:07 PM
Password protected entries HHH Linux - General 3 06-27-2001 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration