westwood
10-19-2003, 02:47 AM
How can I prevent link to my images from a different server? SB is stealing my band width.
Do I need set sth on apache?
thanks
Do I need set sth on apache?
thanks
![]() | View Full Version : How can I prevent link to my images from a different server westwood 10-19-2003, 02:47 AM How can I prevent link to my images from a different server? SB is stealing my band width. Do I need set sth on apache? thanks null 10-19-2003, 03:24 AM From Url Rewriting Guide (mod_rewrite) http://httpd.apache.org/docs/misc/rewriteguide.html Description: Assume we have under http://www.quux-corp.de/~quux/ some pages with inlined GIF graphics. These graphics are nice, so others directly incorporate them via hyperlinks to their pages. We don't like this practice because it adds useless traffic to our server. Solution: RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.quux-corp.de/~quux/.*$ [NC] RewriteRule .*\.gif$ - [F] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !.*/foo-with-gif\.html$ RewriteRule ^inlined-in-foo\.gif$ - [F] Good luck! null sprintserve 10-19-2003, 06:56 AM Add a .htaccess to your main web directory. Replace yourdomain.com with your real domain. You can remove the line with trusted.com. But basically you can add as many of those if you have certain domains (other than www.yourdomain.com that you want to allow the access. You can also add other filetypes other than gif and jpegs if you do have them (example zip, rar etc) Rewriteengine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.trusted.com/.*$ [NC] RewriteRule .*\.(gif|GIF|jpg|JPG)$ - [F] obviousl 10-19-2003, 07:53 AM Turn hot linking on in Cpanel if you use it. :) Chris gamesxposed 10-19-2003, 09:12 AM How is it possible to only block one domain, there is only 1 domian (other site) wasteing my bandwidth, but everyone else is fine. Ive tried adding stuff in my perl script that is used for public uploading, but had no luck, Any ideas? Thanks! sprintserve 10-19-2003, 10:14 AM Frankly it makes no sense to block just one domain. If you have a problem with one site linking, you should block it so that if any other sites tries it in future, you won't have an issue. SROHost 10-19-2003, 12:16 PM Keep in mind that some people use browsers, proxies or other "privacy software" which blocks the HTTP_REFERER header. Those people will also be prevented from seeing your images, so if it's a large site you may want to be ready to point them to a FAQ to fix their systems when they ask. |