Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-03-14
4
Medium Priority
?
246 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:egoselfaxis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 1500 total points
ID: 37719925
For the most safety, move the directory outside of the WWW root.  But that said, if your server returns a 403 forbidden to browsers, you are also returning a 403 forbidden to search engines.  No compromise is likely at all since you're not sending the data -- just the "forbidden" headers.
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 37720064
here is some info for it

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

hope it helps
0
 
LVL 7

Expert Comment

by:torakeshb
ID: 37723890
Refer to the article http://www.experts-exchange.com/OS/Linux/A_8789-How-websites-can-be-redirected.html. You may need some customization as per your requirement
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 37744101
Was there something wrong with this answer?  Why did you mark it down to a "B"?  What was missing?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
The viewer will learn how to count occurrences of each item in an array.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question