Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8212105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:39:21+00:00 2026-06-07T10:39:21+00:00

I have a directory on my website that I need to make sure no

  • 0

I have a directory on my website that I need to make sure no one but myself can get into. From the reading I’ve done, it looks like there are two ways to protect a directory:

  1. Password protect the directory using the .htaccess file
  2. Deny access to all IP addresses but my own from accessing the directory, also using the .htaccess file

I need to protect the files in the directory as securely as possible, so I figured I’d use both of those methods for double protection.

Question 1: Am I missing anything? (i.e. is there another layer of protection I can add?)

Question 2: What would I need to put in a .htaccess file to get the above to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:39:23+00:00Added an answer on June 7, 2026 at 10:39 am

    Your .htaccess file would contain:

    AuthUserFile /usr/local/nate/safe_place/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Protected Files"
    AuthType Basic
    
    require user nate
    order deny, allow
    deny from all
    allow from 127.0.0.1
    

    The .htaccess file goes in the directory you’re trying to protect.

    You also need a .htpasswd file (shown above as /usr/local/nate/safe_place/.htpasswd) which contains the text username:password_hash. So if we use “nate” as an example and “secret” as the password (please don’t use that) you get:

    nate:XmN6pwFyy3Il2
    

    You can use this tool to generate your own password file: http://www.tools.dynamicdrive.com/password/

    Just make sure that no one can read your .htpasswd file. Also note that basic authentication does no encryption by itself. If you’re on an open network, anyone can see your password and all the secret data going over the network. Make sure you visit your site via https if it’s really that secret.

    You can read more about .htaccess files here:
    http://www.javascriptkit.com/howto/htaccess.shtml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website and right now users can just open a directory and
I'd like to make sure that after editing and then navigating away from a
We have an ASP.NET MVC website that a customer is requesting Active Directory single
Windows 2003/IIS 6... I have a virtual directory on a web site that closely
I have a MOSS web site with its virtual directory in IIS. That VD
I have a directory on my website with several mp3's. I dynamically create a
I have a software package placed in the root directory of my website. I'd
I have a website which using active directory authorization on a windows server in
I have recently created a directory for a customer of mine. The website is
I have IIS 7.5 With one web site I added new virtual directory and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.