![]() |
Hotlinking Prevention?
Hi guys,
Can someone please tell me how to prevent people hotlinking to my images using .htaccess? Thanks! ------------------ Snazzy SnazzyTGP.com |
I'm not one of them but there ought to be a hundred guys in here that can help you with this one! I know how to do it on a Windows server and have it setup on some of the Linux servers we have but I wasn't the one that actually configured the .htaccess file. Hopefully they can do better then "format c:" and give you a quick answer!!! I know it can be done.
Brad |
Have you tried format c: ?
[This message has been edited by twistyneck (edited 01-19-2002).] |
This is a sample that someone once gave me...
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> ErrorDocument 404 http://www.yourdomain.com/ ErrorDocument 403 http://www.yourdomain.com/ AuthUserFile /dev/null AuthGroupFile /dev/null RewriteEngine On ErrorDocument 404 http://www.yourdomain.com/ ErrorDocument 403 http://www.yourdomain.com/ RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yournumericip/.*$ [NC] RewriteRule .*\.gif*$ - [F] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yournumericip/.*$ [NC] RewriteRule .*\.JPG*$ - [F] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yournumericip/.*$ [NC] RewriteRule .*\.jpg*$ - [F] RewriteCond %{HTTP_REFERER} ^http://.*np.r-18.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://203.138.134.108 [OR] RewriteCond %{HTTP_REFERER} ^http://210.150.173.167 [OR] RewriteCond %{HTTP_REFERER} ^http://210.136.157.163 [OR] RewriteCond %{HTTP_REFERER} ^http://*.exe.*$ RewriteRule \*$ http://www.yourdomain.com/ [R,L] RewriteCond %{HTTP_USER_AGENT} ^DISCo\Pump.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Drip.* [OR] RewriteCond %{HTTP_USER_AGENT} ^EirGrabber.* [OR] RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro.* [OR] RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE.* [OR] RewriteCond %{HTTP_USER_AGENT} ^FlashGet.* [OR] RewriteCond %{HTTP_USER_AGENT} ^GetRight.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Gets.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Grafula.* [OR] RewriteCond %{HTTP_USER_AGENT} ^IBrowse.* [OR] RewriteCond %{HTTP_USER_AGENT} ^InterGET.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Internet\Ninja.* [OR] RewriteCond %{HTTP_USER_AGENT} ^JetCar.* [OR] RewriteCond %{HTTP_USER_AGENT} ^JustView.* [OR] RewriteCond %{HTTP_USER_AGENT} ^MIDown\tool.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Mister\PiX.* [OR] RewriteCond %{HTTP_USER_AGENT} ^NearSite.* [OR] RewriteCond %{HTTP_USER_AGENT} ^NetSpider.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Offline\Explorer.* [OR] RewriteCond %{HTTP_USER_AGENT} ^PageGrabber.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Papa\Foto.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Pockey.* [OR] RewriteCond %{HTTP_USER_AGENT} ^ReGet.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Slurp.* [OR] RewriteCond %{HTTP_USER_AGENT} ^SpaceBison.* [OR] RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Teleport.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebAuto.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebCopier.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebFetch.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebReaper.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebSauger.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebStripper.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebWhacker.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebZIP.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Web\Image\Collector.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Web\Sucker.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Webster.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Wget.* [OR] RewriteCond %{HTTP_USER_AGENT} ^eCatch.* [OR] RewriteCond %{HTTP_USER_AGENT} ^ia_archiver.* [OR] RewriteCond %{HTTP_USER_AGENT} ^lftp.* [OR] RewriteCond %{HTTP_USER_AGENT} ^tAkeOut.* RewriteRule .*\.jpg*$ http://www.yourdomain.com/ [R,L] RewriteCond %{HTTP_REFERER} ^http://.*adfilter.com.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://207.198.147.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://www.neocities.* [OR] RewriteCond %{HTTP_REFERER} ^http://chat.passagen.s.* [OR] RewriteCond %{HTTP_REFERER} ^http://volpi.sti.com.* [OR] RewriteCond %{HTTP_REFERER} ^http://batepapo0.uol.com.* [OR] RewriteCond %{HTTP_REFERER} ^http://batepapo1.uol.com.* [OR] RewriteCond %{HTTP_REFERER} ^http://batepapo2.uol.com.* [OR] RewriteCond %{HTTP_REFERER} ^http://batepapo3.uol.com.* [OR] RewriteCond %{HTTP_REFERER} ^http://batepapo4.uol.com.* [OR] RewriteCond %{HTTP_REFERER} ^http://batepapo6.uol.com.* [OR] RewriteCond %{HTTP_REFERER} ^http://batepapo7.uol.com.* [OR] RewriteCond %{HTTP_REFERER} ^http://209.2.137.* [OR] RewriteCond %{HTTP_REFERER} ^http://207.126.121.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://.*bianca.com/.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://.*angelfire.com/.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://.*hotmail.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://.*yahoo.com.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://.*geocities.com.*$ [OR] RewriteCond %{HTTP_REFERER} ^http://www.partyhouse.*$ RewriteRule .*\.jpg*$ http://www.yourdomain.com/ [R,L] Hope this helps.... http://bbs.gofuckyourself.net/board/biggrin.gif turbo ------------------ Last Chance Inn & Saloon Liquor In The Front Poker In The Rear!! |
Hat's off Turbo
-It's refreshing to see really good questions answered in sometimes!! :-) |
Thanks Turbo!! You da man!! I'll try it out right away http://bbs.gofuckyourself.net/board/smile.gif
------------------ Snazzy SnazzyTGP.com |
*Bows down to Turbo*
|
*blushes*
no problem. |
Check out the script at http://www.custom-cgi.com/free/bandwidth_protector/
Looks like it could do the trick and give you some free advertising at the same time.. When someone tries hotlinking, it sends a .gif or html file that you determine instead of the pic/s they are trying to link to. |
Turbo,
That .htaccess you posted worked beautifully, thankyou! Try to access this image: http://www.snazzytgp.com/galleries/l...s/sd052_01.jpg http://bbs.gofuckyourself.net/board/smile.gif ------------------ Snazzy SnazzyTGP.com |
excellent Turbo,
now can anyone explain it to me? there's a lot of shit in there and i wouldn't mind understanding all of it. also, just looking at it quickly it seems to me that u can optimize the gif/JPG/jpg part. notice that the GIF part is missing too. ------------------ HQ Daily Nude Trade Traffic w/HQ Eraser Cash Oliver Klozov Amateur Pages |
Turbo,
Slight problem... When I try to enter a url, for example: http://www.snazzytgp.com/mydir/ It redirects me to my main homepage. Any ideas how to overcome this? ------------------ Snazzy SnazzyTGP.com |
|
Snazzy,
This is normal; in your account, people are not allowed to see directory indexes (if there's no index.htm/html file in that directory). So the file is not existing, your .htaccess gets alive and you're redirected. Brgds, Carl Quote:
------------------ CobaltWeb - High Volume Hosting - $0.70-$0.61 per GB - Plans from $13.99 per Month - No Setup Fee ---The End of Free Hosting--- |
Quote:
|
Quote:
------------------ http://www.tgpdevil.com/qas.gif |
i can also access http://www.snazzytgp.com/galleries/l.../sd052_01.jpg.
let's see if gfy can: http://www.snazzytgp.com/galleries/l...s/sd052_01.jpg btw, can any explain me details about the .htaccess codes above? ------------------ HQ Daily Nude Trade Traffic w/HQ Eraser Cash Oliver Klozov Amateur Pages |
Snazzy,
This will get you what you need and isn't as long. ErrorDocument 400 http://www.yourdomain.com ErrorDocument 401 http://www.yourdomain.com ErrorDocument 403 http://www.yourdomain.com ErrorDocument 404 http://www.yourdomain.com ErrorDocument 410 http://www.yourdomain.com ErrorDocument 500 http://www.yourdomain.com RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://yourdomain.com.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com.*$ [NC] RewriteRule .*\.(gif|GIF|jpg|JPG|zip|ZIP|png|PNG|swf|SWF)$ - [F] Also you can add another line like this RewriteCond %{HTTP_REFERER} !^http://youripnumber.*$ [NC] But instead of yourdomain.com put in your ip number just in case anyone is trying to access it through you ip number. Name the file .htaccess in text format but without the txt extension. Upload in what ever directory you need it to work for. It works downward, meaning if you were to upload it to your root directory it will protect all the subdirectories as well. Good luck ------------------ http://www.lostbush.com/sub.html High conversion Cheerleader Fetish |
Here's another one that works very well for me. Use ammo325 directions..
AuthUserFile /dev/null AuthGroupFile /dev/null AddHandler server-parsed .html RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com:80/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yourdomain.com:80/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://999.999.999.999/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://999.999.999.999:80/.*$ [NC] RewriteRule .*\.jpg$ http://www.were-to-send-them.com [R,L] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com:80/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://yourdomain.com:80/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://999.999.999.999/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://999.999.999.999:80/.*$ [NC] RewriteRule .*\.gif$ http://www.yourdomain.com [R,L] ErrorDocument 404 http://www.were-to-send-them.com Above are just for .jpg and .gif, if you have movie page then change the .jpg or .gif to what ever Forgot make sure you use ASCII when FTP'ing or you will screw it up.. Jim [This message has been edited by jimmyf (edited 01-21-2002).] [This message has been edited by jimmyf (edited 01-21-2002).] |
yeah i thought it could be more optimized.
this line can be optimized more too, to handle every case like these: (jpg, JPG, Jpg, and whatever else): RewriteRule .*\.(gif|GIF|jpg|JPG|zip|ZIP|png|PNG|swf|SWF)$ - [F] ------------------ HQ Daily Nude Trade Traffic w/HQ Eraser Cash Oliver Klozov Amateur Pages |
Okay well all of these scripts do work properly almost, but whenever I try to access an html file from somewhere lets say:
http://www.snazzytgp.com/galleries/latina/index.html it automatically redirects to my homepage. What line of code do I need to put in to stop that from happening? ------------------ Snazzy SnazzyTGP.com |
Yeah these .htaccess files that have been posted work great, except when you try to access .html files from within my /galleries/ directory. As soon as you do, it automatically redirects the visitor to my homepage.
Is there anyway to protect my images but at the same time allowing .html pages to be seen? ------------------ Snazzy SnazzyTGP.com |
bump!
|
Thanks HQ that was gonna be my next ??
|
Anyone know how to use the hotlink prevention but then allow specifik files to be hotlinked?
|
All times are GMT -7. The time now is 07:18 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123