|
|
|
|
|
|
|
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
![]() |
#1 |
I'm normally not a praying man, but if you're up there, please save me Superman!
|
How can I protect my images from beeing hotlinked?
Hey guys, I just saw some traffic coming from http://board.freeones.com, where I found a link to a gallery of mine. I believe there're also other posts, but pointing directly to the images, any suggestion how should I protect myself from hotlinking?
I can use .htaccess to protect based on the HTTP referer and if the click is not from my site it will return 404, is this good enough?
__________________
The tendency is to push it as far as you can -- Fear and Loathing In Las Vegas |
![]() |
![]() |
![]() |
#2 |
Pay No Attention To Me, I Am Insane
|
Yes, that's fine OR you can redirect the hotlinkers to somewhere useful.
I just use hotlink protection on a lot of my domains, some I redirect like this one: ###HOTLINKING BEGIN RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://thissite.com.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.thissite.com.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://thissite.com:80.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.thissite.com:80.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://othersite.com.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.othersite.com.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://othersite.com:80.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.othersite.com:80.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://1.2.345.678.9.*$ [NC] RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.someplacetoredirect404.co...MOVE/NO_NO.gif ###HOTLINKING END
__________________
Order Traffic Here SE Cloaker That I KNOW Works Multi IP, PR Hardlinks From $35/mo |
![]() |
![]() |
![]() |
#3 |
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
Code:
###HOTLINKING BEGIN RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://thissite.com [NC] RewriteCond %{HTTP_REFERER} !^http://www.thissite.com [NC] RewriteCond %{HTTP_REFERER} !^http://othersite.com [NC] RewriteCond %{HTTP_REFERER} !^http://www.othersite.com [NC] !^http://1.2.345.678.9[NC] RewriteRule .*\.([Jj][Pp][Gg]|[Gg][Ii][Ff])$ http://www.someplacetoredirect404.c...EMOVE/NO_NO.gif [R,L] ###HOTLINKING END Fewer rules = better, however, there are certain regexp rules that take more processing than chained rules. anchored matches are always better
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
![]() |
![]() |
![]() |
#4 |
Pay No Attention To Me, I Am Insane
|
I dunno. I've run millions and millions of hits across it with no trouble.
First, mod-rewrite is voodoo. If it works like it's supposed to work, then I leave it be. I guess he could go to apache.org and write his own .. ![]() I'm no Apache tech. ![]()
__________________
Order Traffic Here SE Cloaker That I KNOW Works Multi IP, PR Hardlinks From $35/mo |
![]() |
![]() |
![]() |
#5 |
I'm normally not a praying man, but if you're up there, please save me Superman!
|
OK here's what I've put there:
###HOTLINKING BEGIN RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.free-pussysite.com [NC] RewriteCond %{HTTP_REFERER} !^http://free-pussysite.com [NC] RewriteRule .*\.([Jj][Pp][Gg]|[Gg][Ii][Ff])$ http://www.free-pussysite.com/404.html [R,L] ###HOTLINKING END It doesn't work, can you point me the errors. I'm too lazy to read mod_rewrite manual trying to figure out why it's not rewriting ![]()
__________________
The tendency is to push it as far as you can -- Fear and Loathing In Las Vegas |
![]() |
![]() |
![]() |
#6 | |
Pay No Attention To Me, I Am Insane
|
Quote:
One thing, you cannot send hotlinkers like this: RewriteRule .*\.([Jj][Pp][Gg]|[Gg][Ii][Ff])$ http://www.free-pussysite.com/404.html You have to send them to an image, like I did. Not to a page ".html". NOW, here's the trick. That "image" is on a different domain IN a folder with .htaccess IN the folder which redirects 404. That image does NOT exist, thus, it's a 404 image and redirected by .htaccess to a page anywhere I chose. AST
__________________
Order Traffic Here SE Cloaker That I KNOW Works Multi IP, PR Hardlinks From $35/mo |
|
![]() |
![]() |
![]() |
|
|