We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,171 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

.htaccess and .htpasswd

I'm not sure where to ask this, if this is the wrong place let me know.

I have password protect a dir on my website(the admin dir) but when I put the user and password in it takes me into that dir. Is there anyway i can make it open a specific file from that dir(admin.php)

my htaccess file

AuthType Basic  
AuthName "Admin Login"  
AuthUserFile C:/wamp/www/diamondback/admin/.htpasswd  
require valid-user

my htpasswd file

user:password

Thanks for looking...............

2
Contributors
2
Replies
1 Hour
Discussion Span
4 Months Ago
Last Updated
4
Views
Question
Answered
GlenRogers
Posting Whiz in Training
256 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

You can (re)set the default file for that folder. It's usually index.php, so you could also upload a file named that, and do a header redirect in code.

pritaeas
Posting Prodigy
Moderator
9,290 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,459
Skill Endorsements: 86

Brilliant! Thanks very much................

GlenRogers
Posting Whiz in Training
256 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 3 Months Ago by pritaeas

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0828 seconds using 2.64MB