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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:47:07+00:00 2026-05-14T07:47:07+00:00

So I have this php web app, and one of my folder contains some

  • 0

So I have this php web app, and one of my folder contains some files that can be downloaded.

I have a download script that modifies the headers, in order to always offer a download link. (instead of showing a picture for example, when you click on a link, a download box pops out)

Right now, if you enter a url like: http://www.mywebsite.com/content/
You get the listing of all the downloadable files, and of course, you can just download them all, without going through the website interface.

Personally, I don’t think it’s a problem, since I often use downthemall or other downloading tool, and this type of access is a great time saver….

But of course my company does not think so :-p They want people to use the interface in order to view the Ads…

Would they be a way, maybe with a protected .htaccess, to leave the folder access to my download script, but deny access to the users…?

I hope I am making sense and you know what I mean 🙂

All help/remarks appreciated!

  • 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-14T07:47:07+00:00Added an answer on May 14, 2026 at 7:47 am

    You can make a .htaccess file and enter Options -Indexes this will disable listing of the files in the directory.

    If you also need the traffic to originate from your site you will need to make a file say… index.php with code that checks $_SERVER['HTTP_REFERER'] to see if the traffic originates from your site.

    EDIT

    Oh I forgot you can actually fix it all in the .htaccess:

    Options -Indexes
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://your-host.com/.*$ [NC]
    RewriteRule ^.* /403-page [L,R]
    

    This will do all the work of the script I suggested, so you won’t need it anymore.

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

Sidebar

Related Questions

I have a web service, defined(WSDL) and implemented in PHP. This one is relatively
I have a PHP-based web app that I'm trying to apply Apache's mod_rewrite to.
Now I have a app to get some data from php file in web
I have following in my config.php file for one of my web app. //db
Say I want to have a simple web app that takes some user input,
I have a web page coded in PHP. This page is for posting a
I have this PHP script which i'm grabbing images from a directory and displaying
I have this simple php script <?php echo '<pre>'; // Outputs all the result
I have developed a PHP web app. I am giving an option to the
I'm developing a PHP web app that handles information about certain companies. 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.