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 253213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:44:34+00:00 2026-05-11T21:44:34+00:00

What are the different approaches to securing a directory? including an index page so

  • 0

What are the different approaches to securing a directory?

including an index page so contents can’t be viewed

the problem with this is that people can still access the files if they know the filename they’re after

including an htaccess file to deny all

this seems to be the best approach, but is there any case that an htaccess file can be passed by? are there any cases as well where htaccess is not available?

restricting folder access

this is also a nice solution, but the problem is, the folder I’m trying to secure should be viewable and writable by the program.

Are there any other ways that folder security can be done?

  • 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-05-11T21:44:34+00:00Added an answer on May 11, 2026 at 9:44 pm

    Best practice for Apache is to use htaccess to restrict – this only restricts from the webserver – but that should be what you need. You can add authentication into this – but for most needs to you can just deny all acess – which hides the directory completely.

    Another method that can also work well with using htaccess to deny direct access would be to use htaccess in your route directory to rewrite urls. This means that a request such as /example/listItems/username/ted can be rewritten as a call to a php or other file such as:

    /application/index.php?module=listItems&username=ted

    The advantage of doing this is that the webserver does not give out paths to any directories so it is much more difficult for people to hack around looking for directories.

    If you want to protect a directory of images you could also use htaccess to redirect to a different directory so that /images/image5.png is actually a call to :

    /application/images/image5.png

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

Sidebar

Related Questions

I'm sure there are different approaches to this problem, and I can think of
Although I realise there are different approaches to securing upload process, I'm still confused
I'm looking at a few different approaches to a problem: Client requests work, some
I have a very strange problem with Android animations, I tried many different approaches
This is basically a question about the readability, style, performance of 2 different approaches
I think my problem may be quite simple, but after trying different approaches I
I think that both (generational and incremental) are different approaches to make the garbage
I've been going over this in my head and trying out different approaches for
I've looked around for a while, tried quite a few different approaches to this
have tried a few different approaches to this but with no success so far.

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.