Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Solve a hotlinking issue
This guide helps you protect against hotlinking on Web Hosting.
Preamble
- Hotlinking, also known as "leeching" or "bandwidth theft", occurs when a website directly integrates resources (such as images, videos, or audio files) hosted on another site, without the latter's authorization.
- This means that the remote site is used to display the content on the hotlinking site, which can result in unauthorized use of resources and bandwidth consumption for the owner of the remote site.
Preventing hotlinking
Content owners can implement measures to prevent hotlinking, such as rules in the .htaccess
file at the root of the website to block requests from specific sites or to redirect to a replacement image:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?infomaniak.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|svg)$ https://infomaniak.com/imagederemplacement.png [NC,R,L]
Replace "infomaniak.com
" above with the address of your site.
Remove the 3 lines google/bing/yahoo
if you do not want these 3 sites to be allowed to display your images.
Link to this FAQ: