Tag Info

Hot answers tagged

5

The usual technique is to use mod_rewrite as suggested by Josh. This isn't perfect but removes the majority of hot-linking so would probably do the job you are looking for. There is a more complex way that almost guarantees no hot-linking: make sure each visitor needs to use a different URL to get the same image: Place the image files where the web server ...


5

I think you're missing an escape for the . in your domain name: Options +FollowSymlinks Options +SymlinksIfOwnerMatch RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://(.+\.)?article-stack\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ ReWriteRule .*.(png|gif|jpg)$ - [N,F,L]


4

Thanks! On further investigation, I also found the hint to add <meta name="robots" content="noimageindex"> to the header of the web page - it is supposed to prevent the page used as the referring page according to a few sources. I'll see if that's sufficient and update my post if necessary.


4

To prevent the image being indexed via the site you are hotlinking from, instead of linking (hotlinking) directly to the source image you could perhaps call a script which reads and serves the appropriate image from the source site together with an X-Robots-Tag: noindex HTTP response header. <img src="/get-image.php?file=my-image-hosted-elsewhere.jpg" ...


4

One programmatic way is to check the referrer to make sure the request came from your site: <?php $yoursite = "yoursite.com"; //Your site url without http:// $yoursite2 = "www.yoursite.com"; //Type your domain with www. this time $referer = $_SERVER['HTTP_REFERER']; //Check if browser sends referrer url or not if ($referer == "") ...


4

You can't do that with .htaccess, as requests for those images don't come from your server. Instead write a filter on your comments that either checks for .ru and then blocks the comment, or use someone elses code to filter comments. The Askimet plugin is pretty good at preventing spam – have you got that installed?


3

Absolutely. As long as the ecommerce server has the bandwidth available and can handle the load this would work just fine. If the ecommerce server cannot handle the load you may want to consider an affordable CDN like Amazon S3 where you only pay for what you use.


3

You can prevent hotlinking with a decent .htaccess file that checks the referrer. RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC] RewriteRule \.(gif|jpg)$ http://www.mydomain.com/angryman.gif [R,L]


3

Hotlinks are links from other websites to images and page components located on your website and can create god awful loading on a web server, especially if you have some blog article go viral or are hosting a movie that gets extra popular. It's why most people who put videos on their website host the actual video on YouTube and let Google's CDN take care of ...


2

You will be hard pushed to find a site that does all that for free. However, imgur.com allows dead simple free image hosting with no discernible limits. There is a feature to group images into albums, but that is mainly for display on imgur itself and not your own organisation. Your other alternative is a CDN solution like Amazon S3/Cloudfront. Unless your ...


2

Using javascript's document.referrer string you can add an overlay on your thumbs saying : Unlicensed used of Flickrshow :-) or better, display some ads by replacing the thumbnail with an ads display script and make money with them, they will quickly correct their website and offload your Apache web server :-) You may find this interesting also ...


2

There is no way to forward the www > cdn without reaching the request on the main server since well they are linking to you. My advice is not to 301 redirect but rather than just flat out 404, hopefully by doing so they will stop hot linking you. While this has some traffic on your server it shouldn't be too much and you should consider upgrading your ...


1

google.com, google.co.uk, etc. are different domains and, therefor, if you only allow one then the others will be blocked. So you have two options. You could write out every Google variant (and Bing variant if you wanted images in their results too, and for other search engines) as conditionals - but that is quite impractical. Another option is that you ...


1

I'm not a master of IIS7 so my response will be pretty limited, through it'll use some logic based on what I do. I don't use Google to track hotlinking, I use various of other applications such as: SOURCE Google Analytics Woopra Mint Clicky StatCounter Reinvigorate PiWiki Open Web Analytics Chart Beat Mix Panel Kiss Metrics ...


1

Unless you have your images on a sub-domain, there is no way to separate the traffic before it hits your web server. One performance tip that might help you is to use both nginx and Apache on the same server. Have apache run on a non-standard port. Have nginx run on port 80 and have it reverse proxy requests to apache. The rewrite rule for the images can ...


1

In short, yes. If you display HTML in a page on your site, which links to images hosted elsewhere, then that is by definition "hotlinking", and is not distinguishable from any other form of hotlinking. It makes no difference whether it's in the original HTML source or loaded via Javascript, the browser should send the same headers including the 'referer' ...


1

Plenty of people run their blog images off of Flickr, including slideshows. There are a couple of minor requirements, like the images linking back to Flickr, but if you want someone else to handle your media, especially if you're asking for free, you have to make some concessions. (In my experience, this isn't even always done and you'd probably have to be a ...


1

Well you can't make the users browser redirect while they are on the other site. You can however make it send a different file instead of the SWF they are hotlinking to. RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC] RewriteRule \.(swf)$ http://yourdomain.com/blocked.swf [NC,R,L] Just ...


1

I tried your code on my local setup and it worked fine. It's likely that something else in your .htaccess is causing this to fail. I notice that you are rewriting the images to http://article-stack.com/- which redirects to another page. It would be best to rewrite to another image or to a 404 error.



Only top voted, non community-wiki answers of a minimum length are eligible