Solved

.htaccess file help needed

Posted on 2013-01-10
4
344 Views
Last Modified: 2013-01-13
I'm trying to pw protect a root folder 'myFolder' and leave the other folders accessible to the public i.e. bobsFolder, suesFolder etc.

can someone show me a sample of how this would be done and I can fill in the blanks?
0
Comment
Question by:tf2012
4 Comments
 
LVL 4

Accepted Solution

by:
schubach earned 250 total points
ID: 38763914
In the root folder, put a .htaccess file like this
authtype basic
authuserfile /usr/local/httpd/users
authname "My Database"
require valid-user
satisfy all

Open in new window


Then in each subfolder, put a .htaccess file like this:
satisfy any

Open in new window

0
 
LVL 7

Assisted Solution

by:Vimal DM
Vimal DM earned 125 total points
ID: 38766113
http://www.addedbytes.com/blog/code/password-protect-a-directory-with-htaccess/
-------------------------------------------------------------------------------------------------------------

Options -Indexes
<FilesMatch "htmltest[0-9]?\.html$">
    Order Allow,Deny
    Deny from all
</FilesMatch>
0
 
LVL 34

Assisted Solution

by:gr8gonzo
gr8gonzo earned 125 total points
ID: 38767206
0
 
LVL 1

Author Closing Comment

by:tf2012
ID: 38772462
thanks
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question