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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:12:14+00:00 2026-05-28T20:12:14+00:00

Using htaccess I’m basically trying to forbid access to the page i.e http://example.com ,

  • 0

Using htaccess I’m basically trying to forbid access to the page i.e http://example.com, but it will still allow people to download files if they have a direct link i.e http://example.com/hi.zip.

I’m using the directory directive to display the basic download page. According to here mod_autoindex.c is used,so basically what I’m trying to do is:

<Files mod_autoindex.c>
    AuthType Basic
    AuthName "Example"
    AuthUserFile "/home/.htpasswd"
    require valid-user
</Files>

Any advice/tips?

  • 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-28T20:12:15+00:00Added an answer on May 28, 2026 at 8:12 pm

    This should work (tested on my webserver: http://www.gopeter.de/test is restricted, http://www.gopeter.de/test/test.zip is allowed)

    AuthType Basic 
    AuthName "Restricted Directory" 
    AuthUserFile /path/to/directory/.htpasswd 
    require valid-user
    
    <FilesMatch "\.(gz|pdf|zip|rar)$" >
        Order allow,deny
        Allow from all
        Satisfy any
    </FilesMatch>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a solution using .htaccess and wildcard subdomains so that http://subdomain.example.com
http://www.example.com/http://www.test.com I have tried many different methods using .htaccess with no luck. I need
What RewriteRule (using .htaccess / mod_rewrite ) should I use to redirect http://example.com/blog/ (with
How to redirect in url by using htaccess in php? http://www.example.com/randomstring/2 i would like
I'm trying to protect a folder using '.htaccess' and '.htpasswd'. I used http://www.tools.dynamicdrive.com/password/ to
Possible Duplicate: Shorten the URL from example.com/page.php?var=letters to example.com/letters Using htaccess, is it possible
I want to redirect http://www.yourdomain.com/page.php? or http://www.yourdomain.com/page.php?var=val to 404 error page using .htaccess .
I want to, using htaccess, allow hotlinking BUT if someone views an image on
so the thing is I'm using .htaccess to hide the index.php but I still
I am trying to redirect /folder to / using .htaccess but all am I

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.