Avatar of egoselfaxis
egoselfaxis
 asked on

Is there any way to restrict the downloading of files within a subfolder using special .htaccess rules?

We have a bunch of client files sitting in a "uploads" folder on our Apache-based site.  Although the directory itself is NOT browseable (403 forbidden - Directory Listing not allowed) ... the client has become concerned that the files themselves might be compromised somehow, .. or indexed by search engines.

Is there any way that we can apply special .htaccess rules to that uploads folder so that the files contained within it can only be downloaded using a PHP script (or something like that)?  We're just looking for a way to secure those files somehow -- without having to reprogram the site so that the file uploads are stored and served up from outside the site root.  Please advise.

Thanks
- Yvan
Apache Web ServerPHPLinux

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ess Kay

here is some info for it

http://www.javascriptkit.com/howto/htaccess.shtml

hope it helps
torakeshb

Refer to the article https://www.experts-exchange.com/OS/Linux/A_8789-How-websites-can-be-redirected.html. You may need some customization as per your requirement
Ray Paseur

Was there something wrong with this answer?  Why did you mark it down to a "B"?  What was missing?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck