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

  • Home
  • SEARCH
  • 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 7918261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:26:37+00:00 2026-06-03T15:26:37+00:00

Dear StackOverflowers, I’m looking for a way to disable access to all folders of

  • 0

Dear StackOverflowers,

I’m looking for a way to disable access to all folders of a specific name, I dynamically make folders with my web app, but some of those folders musn’t be accessed by others.

say my app makes folders:
Images
Videos
Scripts

and I want to make all the created folders Scripts be inaccessible? How would I go and make this happen? I’m not that familiar with htaccess, I know its possible to put a htaccess file in every directory, but I want to limit the disk read/writes to make sure the app is fast enough, is there a generic way to do this with 1 htaccess file?

A million thanks in advance!

  • 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-03T15:26:39+00:00Added an answer on June 3, 2026 at 3:26 pm

    Using Apache’s <DirectoryMatch> directive, you can easily set this up at the server level or VirtualHost level. However, you need access to the core configuration files to do so.

    <DirectoryMatch "(Images|Videos|Scripts)" >
      Order deny,allow
      Deny from all
    </DirectoryMatch>
    

    To accomplish the same in a .htaccess file, you’ll probably need to make a RewriteRule at the top level.

    RewriteEngine On
    # Match directory names and forbid access with the F flag
    RewriteRule  .*(Images|Videos|Scripts) - [F]
    

    The above should match requests like:

    http://example.com/stuff/Images/otherstuff
    http://example.com/Images1234
    http://example.com/dir/dir/dir/Videos/123.mpg
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear all devexpress winform gurus:) My way is simple. First, i create a bindinglist:
Dear Stackoverflowers, I am trying to build a simple web application in ASP.NET where
dear all..i have a table it looks like: Name version DDX 01 DTX 05
Dear all. I need to keep some temporary information in code. When i access
Hello Dear StackOverflowers, I am new to web programming and finding the server-client mixture
Dear all how could im set response status in Asp.net Web service method ?
dear all.i newbie at web programming and until now i still have learn about
dear all..i have some data at DB. name Range bla 123x9901-123x0000 //it means range
Dear Stackoverflowers, I would like to know what sollutions you can come up with
Dear all, I have a question about Facebook Page: ( NOT user profile page,

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.