14

No, it's not OK, unless you have permission to do so from the content owner and host. It wastes resources and if it's an image meant to be seen on a page, it wastes potential conversions (+ credit) that the other site should be getting. Eventually you may start to see scary things that can terminate your hosting plan, such as naked people in place of the ...


8

Your example [http://example.com/image.jpg] is correct. You will need to enable this by setting $wgAllowExternalImages to true in your configuration file. The default is false. Optionally, you can set $wgAllowExternalImagesFrom to allow exceptions while $wgAllowExternalImages remains set to false. You can also use $wgEnableImageWhitelist to allow exceptions ...


8

I've seen some very embarrassing/hocking examples of hotlinking payback/revenge which caused users to be banned from the forums they had posted a hotlink in. To go more into detail for some who may not realize exactly what was meant from previous answers and for those who'd be dumb enough to hotlink from a place that doesn't want you to hotlink: Say you ...


5

Linking to resources on another site such as images is generally frowned upon unless the site that hosts the images intends for this to happen. The reason for this is simple. It can take a lot of network bandwidth away from the site owner for your gain. You have to be careful that you are not using copyrighted resources without permission. If you have ...


5

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.


5

Using https://www.htaccesstools.com/hotlink-protection/ RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.com [NC] RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L] You may or may not need RewriteEngine on. The next line allows a blank referrer. You may need to examine your log files and may optionally ...


4

The thumbnail versions of images are cached on google's servers, but as soon as the user clicks on one of the image thumbnails to expand the image in image search, their browser will load the full version of the image which is hotlinked. Because the full images are hotlinked like this, you are indeed able to track these hits in your server logs.


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

Actually, [http://example.com/image.jpg] is not correct. The correct way to insert an external image into a wikimedia page is http://example.com/image.jpg eg. no square brackets. Of course, make sure that you have added $wgAllowExternalImages = true to your configuration file to enable display of the image, as wikimedia defaults to not allowing externally ...


3

To stop hotlinking you can add the following to your .htaccess file. Replace example.com on line 3 with your own domain name. Also add or remove any file extensions on line 4 RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)example.com/.*$ [NC] RewriteRule \.(gif|jpg|jpeg|png|bmp|zip|rar|mp3)$ - [F] Maybe you ...


3

It may interest you that the highest court in the European Union has ruled that hotlinking content is always legal, except if the content isn't publicly accessible at the site where it its hosted. (For example, if the content is behind a paywall.) This doesn't mean that embedding third-party comes without risks, though. As @dhaupin mentions, a site can ...


3

Duplicate pages (regardless of domain) frustrates users. Imagine if google's duplicate content penalty was never in place. If a user searched for a term and found it on one of your sites, then your second site will be listed underneath it. If the user did not like the first entry, surely, there will be some sadness because the next entry is the duplicate of ...


2

I am assuming Apache and .htaccess. From: https://perishablepress.com/creating-the-ultimate-htaccess-anti-hotlinking-strategy/ RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$ [NC] RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?domain\. [NC] ...


2

If your subscribers have to login to your website, then you could use a PHP script in your images folder to check that they are logged in before serving an image in the same way you would check this before serving them a subscriber-only webpage. Your .htaccess file might have: # Protect subscriber-only assets from hot-linking (*.gif) RewriteCond %{...


2

I have some client sites for companies that will write you a very nasty letter to immediately remove those links and will sue you if don't remove them immediately. You should presume any content on a site is already copyrighted or trademarked and that bad things can happen to you if you use them without permission.


2

There are more than 150+ domains targeting my images & sending spammed links to my site. I just want to prevent hotlinking from them. I just want to block only those specific sites. "150" is a little excessive to block specifically and this may become hard to maintain in the future. It would be more usual to block all hotlinking sites as in @closetnoc's ...


2

Do I need to explicitly add every search engine & social media... Potentially, yes. However, it does depend on how the third party (search engine / social media platform) fetches/caches your images. If Google image search is a concern then you will need to punch a hole in your hotlinking protection to allow google.com as the Referer. Whilst googlebot ...


2

Thanks guys. I've got it working by adding this rule RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www-patchworkoftips-com.cdn.ampproject.org [NC].


1

This will return a 403 “Forbidden” response whenever any of these file extensions are requested from a site other than your own. RewriteRule \.(gif|jpe?g?|png|mp3|mp4|wmv|flv|avi)$ - [NC,F,L] You also need to add the site exception rule underneath the hotlinking rule. The .htacces file works in a cascading fashion just like a CSS file. So those (example....


1

Here is an article about this where they explain how to implement it. Show full images on your own site, but only show the watermarked version in Google image search. The basic technique is to choose which version to serve (watermarked or clean) based on HTTP Referer and User Agent. If the HTTP Referer is from your own site, show the clean version. If the ...


1

The ideal way would be handling this at nginx level. Do something like this: If page requested == "/images/watermark.jpg" If useragent == bot Rewrite (internal) to something like "/images/bot/watermark.jpg" Step 1 Add this in your nginx config. map $http_user_agent $limit_bots { default 0; ~*(google|bing|yandex|msnbot) 1; ~*(AltaVista|...


1

Facebook uses the facebookexternalhit user agent facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" Google+ uses a user agent containing "Google" Google (+https://developers.google.com/+/web/snippet/) You should grant them access by user agent.


1

If what you mean is making a link between the image and the article, then you could include your image in a link: <a href="/my/url/to/my/article.html"> <img src="/my/url/to/my/image.png" width="42" height="42"> </a> When people click on your image, they would be directed to the corresponding article.


1

This is the code you need RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^https?://(www\.)?your-domain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^https?://(www\.)?google\..+$ [NC] RewriteRule \.(gif|jpg|jpeg|png)$ https://your-domain.com/hotlink.jpg [R,L] This code loads hotlink.jpg for sites hotlinking your images, Except ...


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