http://mysite.com/uploads

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
hlloyge
Forum Members
Forum Members
Posts: 11
Joined: Mon Apr 02, 2007 4:49 pm

http://mysite.com/uploads

Post by hlloyge »

Hello.

How can I avoid direct accessing (for example, typing adress?) to www.mysite.com/uploads? I run CentOS 5, Server version: Apache/2.2.3. Is it something with httpd config?

Thank you.
Pierre M.

Re: http://mysite.com/uploads

Post by Pierre M. »

Hello hlloyge,

Try to search "avoid deep linking" in webservers' documentations and on the web.
Lighttpd has a feature. And as you have said, Apache may be tweaked with the appropriate config.
I'm too lazy today to point you to the solution but I'm sure it can be made with the webserver "under" CMSms.
Once you have found it you can write it in the wiki.

Pierre M.
hlloyge
Forum Members
Forum Members
Posts: 11
Joined: Mon Apr 02, 2007 4:49 pm

Re: http://mysite.com/uploads

Post by hlloyge »

I've found much simpler solution; I just put index.html inside that folder with scary message about IP being logged and mail sent to administrator ;D I'm not dealing with hackers, so this is TEH protection ::)
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: http://mysite.com/uploads

Post by tsw »

something like this should work also

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ blocked.gif [NC,R,L]

-tsw
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: http://mysite.com/uploads

Post by calguy1000 »

If you use the uploads module it does this:
  a) Prevents direct linking
  b) Provides tracking of how many times a file is downloaded, and from where
  c) Allows a description, an image, and a type to be attached to a file
  d) allows complete customization of the output.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
hlloyge
Forum Members
Forum Members
Posts: 11
Joined: Mon Apr 02, 2007 4:49 pm

Re: http://mysite.com/uploads

Post by hlloyge »

calguy1000 wrote: If you use the uploads module it does this:
  a) Prevents direct linking
  b) Provides tracking of how many times a file is downloaded, and from where
  c) Allows a description, an image, and a type to be attached to a file
  d) allows complete customization of the output.
Is it? Well, I can tweak site a bit... will play with it. Thank you all. For now, my solution works... but it's not something I'd like to have... it isn't idiot-proof.
Post Reply

Return to “CMSMS Core”