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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:25:40+00:00 2026-06-10T07:25:40+00:00

I would like to deny all files in a directory, but index.php (as being

  • 0

I would like to deny all files in a directory, but index.php (as being the default page).

This solutions works almost:

Deny from all
<Files index.php>
    Order Allow,Deny
    Allow from all
</Files>

The only problem: ‘upload/index.php’ is now accessable, but ‘/upload/’ isn’t. How can I allow the default page with htaccess?

  • 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-10T07:25:41+00:00Added an answer on June 10, 2026 at 7:25 am

    Your problem is, as you may have figured it out, that you’re denying all the stuff, then allow the URI ‘index.php’, but not the URI ‘/’ — even though the ‘/’ gets redirected to the index.php behind the scenes, it’s still a different URI, and thus it should be allowed too.

    The easiest way to do it is using the FilesMatch directive, like this:

    order allow,deny
    <FilesMatch "^(index\.php)?$">
        allow from all
    </FilesMatch>
    

    The regex ^(index\.php)?$ means “index.php or nothing”.

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

Sidebar

Related Questions

I would like to distribute my 20-jar application as pack200 files, but I also
I would like to serve static plist files using mod_wsgi . In have configured
Imagine a URL like this: http://hostname/a/b/xy-00:11:22:33:44:55-/c I would like to put an .htaccess file
I am trying to redirect all (dynamic)subdomains to a page with querystring but it's
I would like to prevent direct url access to some selected directories. But then
I have the following directory structure in htdocs: htdocs/ .htaccess index.php foo/ bar/ priv/
I have password protected my entire website using .htaccess but I would like to
I would like to use a custom page for some HTTP error, so I
I've followed all the steps in multiple tutorials to enable mod_deflate in Apache but
Do you know any ways to protect a database in Android? I would like

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.