logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: htaccess alias directory question
Author
Brian



Joined: 21 Oct 2005
Posts: 209
Location: Puyallup, WA USA

PostPosted: Wed 17 Jan '07 7:35    Post subject: htaccess alias directory question Reply with quote

Okay, what am I doing wrong here, I want to allow various users to place their .htaccess password files in a specific location such as:

x:/members/passwords/{member_id}/

In this example the .htaccess would look something like this:
Code:
AuthName "Password Required for this directory:"
AuthUserFile ~passwords/Brian
AuthType Basic
Require user Brian

Order Allow,Deny
Allow from  localhost
Satisfy Any


This problem is, I thought that I could Alias the ~passwords to something like x:/members/passwords/.

Does this make sense?

In my Apache CONF file I insert this:
Code:
######## Alias for .htaccess ########
Alias ~passwords/ "x:/members/passwords/"
#####################################


When I review the error.log, I see it is looking in c:/~passwords... and not x:/members/passwords/Brian

I thought that this would point to x:/members/passwords/brian, or what ever username is in the .htaccess file.

What am I doing wrong here?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Wed 17 Jan '07 10:47    Post subject: Reply with quote

Hello Brian!

Your alias isn't correct. Your forgot the first slash

working is:
Code:

Alias /~passwords/ "x:/members/passwords/"


With that you will get an 403 Wink do not forget to set location permissions in httpd.conf for x:/members/passwords/ Very Happy
Back to top
Brian



Joined: 21 Oct 2005
Posts: 209
Location: Puyallup, WA USA

PostPosted: Wed 17 Jan '07 16:07    Post subject: Reply with quote

Using the exact example you illustrated above James, I thought this would work as well but the resulting error is:

Code:
[Wed Jan 17 05:58:37 2007] [error] [client xx.xx.xx.xx] (OS 3)The system cannot find the path specified.  : Could not open password file: C:/~passwords/Brian/passwords, referer: http://www.someurl.com/members/pages/somescript.php


So for some odd reason it is not trying to match /~passwords/. I will test on another server. I have a testing WAMP box I set up at work, I'll see what the results there are.

--
Brian
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Wed 17 Jan '07 16:35    Post subject: Reply with quote

Hm, that confuses me! Beause I extra tested that before is posted that!
Back to top


Reply to topic   Topic: htaccess alias directory question View previous topic :: View next topic
Post new topic   Forum Index -> Apache