1,105,169 Community Members

.htaccess and .htpasswd

Member Avatar
GlenRogers
Posting Whiz
329 posts since Jan 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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...............

Member Avatar
pritaeas
mod_pritaeas
11,285 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,829 [?]
Skill Endorsements: 154 [?]
Moderator
Featured
Sponsor
 
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.

Member Avatar
GlenRogers
Posting Whiz
329 posts since Jan 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Question Answered as of 1 Year Ago by pritaeas
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article