ASE Labs
Welcome Guest. Please register or log in now. There are 1234 people online (0 Friends).
  • Home
  • Articles
  • News
  • Forum
  • Register/Login

Blocking Leeching using .htaccess

There are 5 messages in this topic Watch this topic for replies Subscribe to this topic
Add Reply Back to forum "Software Discussion" Back to Index
Aron Schatz Avatar 2014: Year of change. Joined: August 3, 2001 Status: Offline Posts: 10753 Rep: PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 1 (332767)
Blocking Leeching using .htaccess Old Sat Aug 13, 2005 8:13:41 AM #12673 Perm Link
I recently found that someone one eBay was directly linking to my pictures AND stole the entire text from my article. http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5795175084
»http://www.aselabs.com/articles.php?id=168

Needless to say, I sent eBay a message about it and I'm waiting to hear the resolution. Moving forward, I want to find out how to use .htaccess to block images coming from certain sites (like ebay or others). It won't stop stealing text, but at least they can't steal images.

2014 is going to be a good year. More content, more streamlining. Be a part of history!
Reply Quote Multi-Quote-Off Send PM Profile
areamike Joined: June 27, 2005 Status: Offline Posts: 787 Rep: PIP Level 2 (6080)PIP Level 2 (6080)PIP Level 2 (6080)PIP Level 1 (6080)PIP Level 1 (6080)
(No Title) Old Mon Aug 15, 2005 11:53:01 AM #12683 Perm Link
In your .htaccess file, enter the following (replace the obvious "yoursite.com" etc. with your configuration):

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com [NC]
RewriteRule [^/]+.(gif|jpg)$ - [F]

If you have additional domains pointing to your main site you can insert them below the primary domain and above the "RewriteRule" line:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursite2.com [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite2.com [NC]
RewriteRule [^/]+.(gif|jpg)$ - [F]

When you have completed your .htaccess file, upload it in ASCII mode via FTP to your /htdocs directory.

To use anti-leeching for sites on subdomains (http://subdomain.yoursite.com), create an .htaccess file for each subdomain like the following:


RewriteCond %{HTTP_REFERER} !^http://subdomain.yoursite.com/ [NC]
RewriteRule [^/]+.(gif|jpg)$ - [F]

To protect your main site and subdomains, add the main site to the subdomain code as follows:

RewriteCond %{HTTP_REFERER} !^http://subdomain.yoursite.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com [NC]
RewriteRule [^/]+.(gif|jpg)$ - [F]

When you have completed your .htaccess file, upload it in ASCII mode via FTP to your /htdocs directory.

If you wish to return a "hey, stop leeching my images and bandwidth!" graphic in place of the leeched images, change this line:

RewriteRule [^/]+.(gif|jpg)$ - [F]

to these lines:

RewriteCond %{REQUEST_URI} !^/restricted_image.jpg
RewriteRule +.(gif|jpg)$ http://www.yoursite.com/stopleeching.jpg

(of course you want to make that "stop leeching" image as small a file as possible, or you're defeating the purpose of saving bandwidth by blocking image use.)

credit:taken from powweb.com knowledge base after I also had problems with bandwidth leeching.
Reply Quote Multi-Quote-Off Send PM Profile
Aron Schatz Avatar 2014: Year of change. Joined: August 3, 2001 Status: Offline Posts: 10753 Rep: PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 1 (332767)
(No Title) Old Mon Aug 15, 2005 12:01:07 PM #12685 Perm Link
In response to areamike #12683
That is for specific allows. I want to specifically disallow. I send pics to other sites when posting news. I just want to prevent sites like ebay.com and others from stealing it specifically.

(Edit: spelling)

Edited at Mon Aug 15, 2005 10:20:50 PM
2014 is going to be a good year. More content, more streamlining. Be a part of history!
Reply Quote Multi-Quote-Off Send PM Profile
areamike Joined: June 27, 2005 Status: Offline Posts: 787 Rep: PIP Level 2 (6080)PIP Level 2 (6080)PIP Level 2 (6080)PIP Level 1 (6080)PIP Level 1 (6080)
(No Title) Old Mon Aug 15, 2005 2:20:07 PM #12689 Perm Link
Well, that is a little impossible I think.

You want to prevent users from stealing your images that you uploaded to some other site(ebay)?
You don't control the ebay servers and I don't think it is possible to block images from being stolen that are on another site.

You could always <a href="http://www.watermarkfactory.com/?from=google">watermark</a> your images.
Reply Quote Multi-Quote-Off Send PM Profile
Aron Schatz Avatar 2014: Year of change. Joined: August 3, 2001 Status: Offline Posts: 10753 Rep: PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 3 (332767)PIP Level 1 (332767)
(No Title) Old Mon Aug 15, 2005 2:22:14 PM #12690 Perm Link
In response to areamike #12689
No. I just don't want them linked from the domain x.com.

The .htaccess you gave will allow from domains. I just need them to deny from specific domains and allow all others.

I do watermark the images, just not the thumbnails.

2014 is going to be a good year. More content, more streamlining. Be a part of history!
Reply Quote Multi-Quote-Off Send PM Profile
Page: [1]
Add Reply Back to forum "Software Discussion" Back to Index

Quick Reply

Login
Welcome Guest. Please register or log in now.
Forgot your password?
Navigation
  • Home
  • Articles
  • News
  • Register/Login
  • Shopping
  • ASE Forums
  • Anime Threads
  • HardwareLogic
  • ASE Adnet
Latest News
  • Kingston HyperX Cloud 2 Pro Gaming Headset Unboxing
  • Synology DS415+ Unboxing
  • D-Link DCS-5020L Wireless IP Pan/Tilt IP Camera
  • Actiontec WiFi Powerline Network Extender Kit Unboxing
  • Durovis Dive Unboxing
  • Bass Egg Verb Unboxing
  • Welcome to the new server
  • Gmail Gets Optional Preview Pane
  • HBO Go on Consoles
  • HP Touchpad Update
Latest Articles
  • D-Link Exo AC2600 Smart Mesh Wi-Fi Router DIR-2660-US
  • HyperX Double Shot PBT Keys
  • Avantree ANC032 Wireless Active Noise Cancelling Headphones
  • ScharkSpark Beginner Drones
  • HyperX Alloy FPS RGB Mechanical Gaming Keyboard
  • D-Link DCS-8300LH Full HD 2-Way Audio Camera
  • Contour Unimouse Wireless Ergonomic Mouse
  • HyperX Cloud Alpha Pro Gaming Headset
  • Linksys Wemo Smart Home Suite
  • Fully Jarvis Adjustable Standing Desk
Latest Topics
  • Hello
  • Welcome to the new server at ASE Labs
  • Evercool Royal NP-901 Notebook Cooler at ASE Labs
  • HyperX Double Shot PBT Keys at ASE Labs
  • Avantree ANC032 Wireless Active Noise Cancelling Headphones at ASE Labs
  • ScharkSpark Beginner Drones at ASE Labs
  • HyperX Alloy FPS RGB Mechanical Gaming Keyboard at ASE Labs
  • D-Link DCS-8300LH Full HD 2-Way Audio Camera at ASE Labs
  • Kingston SDX10V/128GB SDXC Memory at ASE Labs
  • What are you listening to now?
  • Antec Six Hundred v2 Gaming Case at HardwareLogic
  • Sans Digital TR5UTP 5-Bay RAID Tower at HardwareLogic
  • Crucial Ballistix Smart Tracer 6GB PC3-12800 BL3KIT25664ST1608OB at HardwareLogic
  • Cooler Master Storm Enforcer Mid-Tower Gaming Case at HardwareLogic
  • Arctic M571-L Gaming Laser Mouse at ASE Labs
  • Contour Unimouse Wireless Ergonomic Mouse at ASE Labs
Press Release
  • Huntkey Has Launched Its New Power Strips with USB Chargers on Amazon US
  • Inspur Releases TensorFlow-Supported FPGA Compute Acceleration Engine TF2
  • Hot Pepper Introduces Spicy New Smartphones in US Markets
  • Sharp Introduces New Desktop Printers For The Advanced Office
  • DJI Introduces Mavic 2 Pro And Mavic 2 Zoom: A New Era For Camera Drones
  • DJI Introduces Mavic 2 Pro And Mavic 2 Zoom: A New Era For Camera Drones
  • Fujifilm launches "instax SQUARE SQ6 Taylor Swift Edition", designed by instax global partner Taylor Swift
  • Huawei nova 3 With Best-in-class AI Capabilities Goes on Sale Today
  • Rand McNally Introduces Its Most Advanced Dashboard Camera
  • =?UTF-8?Q?My_Size_to_Showcase_Its_MySizeId=E2=84=A2_Mobil?= =?UTF-8?Q?e_Measurement_Technology_at_CurvyCon_NYC?=
Home - ASE Publishing - About Us
© 2010 Aron Schatz (ASE Publishing) [Queries: 19 (9 Cached)] [Rows: 367 Fetched: 62] [Page Generation time: 0.024685859680176]