Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Security challenge with .htaccess, .htpassword

Status
Not open for further replies.

cameronpenn

Technical User
Feb 5, 2002
1
US
The normal way .htpassword files are used is either the user/password is on the list - in which case they get access or they're not, in which case they get sent to an "authorization required" page.

I'm looking for a way send users who type in something that doesn't match a user/password in the .htpassword file to be redirected to a page along with the data they typed. I could certainly change the "authorization required" page into a redirect, but that wouldn't pass the login and password they typed.

Anyone know a good way to do this? Any ideas where I should be looking for an approach to doing this? Is this even possible with .htaccess? Any help would be greatly appreciated. :)
 
If you have PHP installed on the server, you could make your error 401 page a PHP script. The script then has access to two variables named $PHP_AUTH_USER which contains the username and $PHP_AUTH_PW which contains the password. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top