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: Protecting files with .htaccess - Error 401
Author
bfkgoner



Joined: 22 Jul 2007
Posts: 1

PostPosted: Sun 22 Jul '07 16:42    Post subject: Protecting files with .htaccess - Error 401 Reply with quote

Hi,

I'm trying to set up a website using PHP-nuke and XAMPP (Apache 2.2.4) and I need to restrict the access to one of my .php files so that a standard windows login/password dialog box appears whenever I try to run the script. In my .htaccess file I write the following:

<Files ~ "\admin.php$">
AuthType Basic
AuthUserFile "C:\server\pass\admin.pass"
AuthName "Password required"
require valid-user
</Files>

where admin.php is the file I need to protect and C:\server\pass\admin.pass is the file where the passwords are stored. Now, when I try to run the script a 401 error page (Authentication required) appears. On the other hand when I try to run it on Apache 1.3 a dialog box appears no problem.

Did they disable the user/password dialog box in Apache 2 or something?.. Any suggestions?
Back to top
James Blond
Moderator


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

PostPosted: Mon 23 Jul '07 10:05    Post subject: Reply with quote

They did not disable that. But the modules have been split and have different names. You have to load mod_authn_file
Also help full is the overview page of the "new" auths
Back to top


Reply to topic   Topic: Protecting files with .htaccess - Error 401 View previous topic :: View next topic
Post new topic   Forum Index -> Apache