[geeks] Apache help

David Cantrell david at cantrell.org.uk
Fri Apr 12 08:52:32 CDT 2002


On Thu, Apr 11, 2002 at 09:29:48PM -0500, Bill Bradford wrote:
> Okay, I need to be able to do this:
> 
> 1.  go to http://web.server.machine
> 2.  Have a login / password box pop up
> 3.  login, say as "user1", with user1's password
> 4.  Get redirected to http://server/users/user1 (or whatever directory tree).
> 
> Thoughts on the easiest way to do this?  MUST be password-protected, and
> *cannot* be normal UNIX users so I cant do /~user1.

Assuming you're using Apache ...

david at plough:/web/www.barnyard.co.uk/foo$ cat .htaccess 
AuthUserFile /web/www.barnyard.co.uk/foo/.htpasswd
AuthGroupFile /dev/null
AuthName "Precious Things"
AuthType Basic
require user username

and in the apache config ...

  <Directory "/web/www.barnyard.co.uk">
    ...
    RewriteEngine on
    RewriteRule ^foo/(.*\..*) http://barnyard.unixbeard.net/bar/$1 [R,L]
  </Directory>

Doesn't do *quite* what you want, but should be a good starting point.

-- 
David Cantrell | Benevolent Dictator | http://www.cantrell.org.uk/david

   When a man is tired of London, he is tired of life
      -- Samuel Johnson



More information about the geeks mailing list