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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:01:23+00:00 2026-05-27T23:01:23+00:00

This is more of a conceptual problem. I have a server, and I have

  • 0

This is more of a conceptual problem.

I have a server, and I have a bunch of downloadable files for which I would like to add a download limit and at the same time log requests. The files have a common set of extensions like JPEG, GIF, and PNG. I know this could be a breeze by setting up a redirection script, but there are a couple of issues with that:

  1. The plain links have been out there for a while, and the redirection script can be bypassed by simply entering the old URL.
  2. The directory structure is truly messy, and that means the script will have to accept the directory in which the files exist, and that will open the door to traversal attacks and whatnot – I know the data can be sanitized.

So, the real question is, how can I accomplish that transparently? I thought of using mod_rewrite in combination with a PHP/Perl script to achieve that, but I am a bit concerned about the possible security repercussions.

Is there any other way?

Thanks!

  • 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-27T23:01:24+00:00Added an answer on May 27, 2026 at 11:01 pm

    I’d say mod_rewrite is the (simple) answer.

    Rewrite requests for images inside your webroot to a script, and as you mention, sanitize the input making sure the file is indeed an image and inside your webroot.

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

Sidebar

Related Questions

I have a label on my asp.net page, it looks like this: more info
This is more of a conceptual question than anything. I have a base class
UPDATE: I've been playing around with this more, and it seems like tmux's clear-history
This is more of a design question. I have a template class, and I
This is more for information then a problem. (On searching Stack Overflow I found
I have a problem at the conceptual level, I read a lot but I'm
This is more of a conceptual question. If it helps, lets say it falls
This is more a conceptual question. Here is my current predicament; I am writing
So this question is not so much technical but more sort of conceptual. I
This a conceptual question on how one would implement the following in Lisp (assuming

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.