https://www.icyphoenix.com/viewtopic.php?f=35&t=2031
-----------------------------------
tiolalu
Tue 22 May, 2007 10:33

Anyway To Protect Posted_img_thumbnails?
-----------------------------------
Edit for security reasons.

I found that in an internet page, and the I understand why my server got collapsed some times, they can access there without login, so, there is any way to protect the file in order not to collapse again the server?

Thanks!


-----------------------------------
Zuker
Tue 22 May, 2007 12:49

Re: Anyway To Protect Posted_img_thumbnails?
-----------------------------------
What do u mean by protect?


-----------------------------------
casimedicos
Tue 22 May, 2007 16:51

Re: Anyway To Protect Posted_img_thumbnails?
-----------------------------------
i do´ not understand what you want to protect and what is the problem

but in the  topic you say that the problem are thumbnails and in the quoted text you put
links ti jpg, i suppose that the problem are the links to your images from other sites

if not

try to explain better the problem

how to avoid hotlinking
http://altlab.com/htaccess_tutorial.html
[code linenumbers=false]How Do I Stop Hotlinking and Bandwidth Theft?
You can stop others from hotlinking your site's files by placing a file called .htaccess in your Apache site root (main) directory. The period before the name means the file is hidden, so you may want to edit your file as htaccess.txt, upload it to your server, then rename the txt file to .htaccess in your directory. Contact your web host on how to access your directories and configure your .htaccess file.


Example: Your site url is www.mysite.com. To stop hotlinking of your images from other sites and display a replacement image called nohotlink.jpe placed in your images directory, place this code in your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+.)?mysite.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

The first line of the above code begins the rewrite. The second line matches any requests from your own mysite.com url. The [NC] code means "No Case", meaning match the url regardless of being in upper or lower case letters. The third line means allow empty referrals. The last line matches any files ending with the extension jpeg, jpg, gif, bmp, or png. This is then replaced by the nohotlink.jpe file in your images directory. This JPEG image is using the extension jpe instead of jpg to prevent blocking your own replacement image.


To stop hotlinking from specific outside domains only, such as myspace.com, blogspot.com and livejournal.com, but allow any other web site to hotlink images:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+.)?myspace.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+.)?blogspot.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+.)?livejournal.com/ [NC]
RewriteRule .*.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

You can add as many different domains as needed. Each RewriteCond line should end with the [NC,OR] code. NC means to ignore upper and lower case. OR means "Or Next", as in, match this domain or the next line that follows. The last domain listed omits the OR code since you want to stop matching domains after the last RewriteCond line.


You can display a 403 Forbidden error code instead of an image. Replace the last line of the previous examples with this line: 

RewriteRule .*.(jpe?g|gif|bmp|png)$ - [F][/code]


Warning: Do not use .htaccess to redirect image hotlinks to another HTML page or server that isn't your own (such as this web page). Hotlinked images can only be replaced by other images, not with an HTML page.

As with any htaccess rewrites, you may block some legitimate traffic (such as users behind proxies or firewalls) using these techniques.

http://www.htaccesstools.com/hotlink-protection/

warning and fAQ
I have enabled hotlinking on all images and movies, will this affect my google ranking? will it stop google caching my images? will it stop google adding my images to google image search? will it stop yahoo adding my videos to yahoo video search?

No - Yes - Yes - Yes.

Were you experiencing a major spike in bandwidth? If so, and you are paying for bandwidth I can understand. If not, I would not enable hotlink protection for images or videos. I would add my URL on all the images and videos. Free advertisement! Alternately you can place the videos in a seperate directory and enable hotlink protection there. Rather then stop this I would look for a way to turn it in to an advantage if possible. Or you can find a free host that will permit videos and serve them from there.


-----------------------------------
tiolalu
Tue 22 May, 2007 17:58

Re: Anyway To Protect Posted_img_thumbnails?
-----------------------------------
No, I have already them protected.

I mean to protect image_thumbnail.php from outside of my site. If you do click on the links in the quote you will see they are using my site to load images from other sites.

Casimedicos, thanks for the extended explanation about .htaccess protect.


-----------------------------------
casimedicos
Wed 23 May, 2007 11:06

Re: Anyway To Protect Posted_img_thumbnails?
-----------------------------------
ok
then
you must try to disable the generation of thumbnails in acp, for all images


-----------------------------------
tiolalu
Wed 23 May, 2007 22:37

Re: Anyway To Protect Posted_img_thumbnails?
-----------------------------------
There is not any way to protect calling this file from the outside?

How to disable it ??


