?
Solved

.htaccess file help needed

Posted on 2013-01-10
4
Medium Priority
?
349 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Accepted Solution

by:
schubach earned 1000 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 500 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 35

Assisted Solution

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

Author Closing Comment

by:tf2012
ID: 38772462
thanks
0

Featured Post

PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

719 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