Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
How do I password protect a directory?
Old 07-27-2011, 11:42 PM How do I password protect a directory?
Super Talker

Posts: 113
Trades: 0
I need to make a directory on my site password protected; nothing fancy, I just need a simple username/password box to pop up to prevent people from stumbling across it. I tried to do this in the .htaccess file, but the whole site became password protected. How can I password protect just one directory? (For example, www.mysite.com/protecteddirectory).
Learnin' n00b is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-28-2011, 02:21 PM Re: How do I password protect a directory?
vangogh's Avatar
Post Impressionist

Posts: 10,816
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Odds are your hosting control panel allows you to create password protected directories with a few clicks.

Can you show what you tried with your .htaccess file. My guess is you just had an incorrect path to the directory. Here's a tutorial on password protection via .htaccess
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 07-28-2011, 10:33 PM Re: How do I password protect a directory?
Super Talker

Posts: 113
Trades: 0
Hi vangogh. This is the code that was in the .htaccess file:

Code:
AuthType Basic
AuthName "restricted area"
AuthUserFile /protecteddirectory/.htpasswd
require valid-user
Learnin' n00b is offline
Reply With Quote
View Public Profile
 
Old 07-29-2011, 10:33 AM Re: How do I password protect a directory?
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
You'd need to use a combination of .htaccess and .htpasswd.

This may be useful:
http://www.webmaster-toolkit.com/hta...enerator.shtml
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 07-29-2011, 03:20 PM Re: How do I password protect a directory?
vangogh's Avatar
Post Impressionist

Posts: 10,816
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Yep. I think the missing .htpasswd file is the culprit. The article I linked to discusses it as well.

However check your hosting control panel. Odds are you can password protect any directory with a couple of clicks.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 08-02-2011, 02:51 PM Re: How do I password protect a directory?
Ultra Talker

Posts: 423
Name: Janice McClean
Trades: 0
If you use cPanel like everyone else these days, there is a simple integrated password protect add-on for directories. It works like a charm.

If not, .htaccess and .htpasswd will do.
__________________
My Site : MacFTW [link coming soon!]

Hosted by:
Please login or register to view this content. Registration is FREE
cantletugo is offline
Reply With Quote
View Public Profile
 
Old 08-02-2011, 02:59 PM Re: How do I password protect a directory?
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
Quote:
Originally Posted by cantletugo View Post
If you use cPanel like everyone else these days, there is a simple integrated password protect add-on for directories. It works like a charm.

If not, .htaccess and .htpasswd will do.
Most people won't have cPanel installed on their localhost, though. It's more for managing a website, one the 'net, in my opinion.

But you are right, htaccess and htpasswd will most certainly work.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How do I password protect a directory?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.92118 seconds with 12 queries