Site AI AuditInternet Solutions द्वारा

Hotlinking: Stop Other Sites Using Your Images and Bandwidth

10 अक्तूबर 20268 मिनट पढ़ेंसुरक्षा और SSL
Hotlinking: Stop Other Sites Using Your Images and Bandwidth

Short answer: Hotlinking is when another website shows your images, videos or files by linking directly to the files on your server instead of hosting its own copies. Every view on their site downloads the file from yours, using your bandwidth and server resources, and often your work without permission. You can block it with a referrer rule in Apache or Nginx, or with the hotlink protection setting of your CDN. Allow requests with no referrer and from search engines and your own domains, so you do not break image search, link previews or visitors with strict privacy settings.

What hotlinking is and why it matters

When a page includes an image, the browser downloads it from whatever address the src attribute points to. If a forum post, a scraper site or an online shop uses <img src="https://yourshop.com/wp-content/uploads/product.jpg">, every visitor of that page fetches the image from your server.

For a small image on a small site this hardly matters. It starts to matter when:

Hotlinking is also a common sign of content scraping. Sites that copy your text often hotlink your images too, because downloading them is extra work. If you find hotlinked product images on an unfamiliar shop, check whether that shop also uses your name or descriptions, as that may be a fraud site.

How to spot hotlinking

Do not over-react to a few foreign referrers. Translation services, web archives, RSS readers and people sharing your page in a chat tool can all appear in logs, and they are usually harmless or even useful. What you are looking for is repeated, heavy use of your files on pages you do not control.

Before blocking, make a short list of legitimate referrers: your own domains and subdomains, staging sites, payment pages that show your logo, marketplaces where you list products with images from your server, and partner sites you have agreed with.

Who must not be blocked

Hotlink protection works by checking the Referer header that browsers send with requests. Getting the exceptions right is what separates a good rule from one that hurts you:

How to block hotlinking on Apache

On Apache, including most shared hosting, you can add rules to the .htaccess file in your site’s root:

The [F] flag returns 403 Forbidden. Some site owners prefer to serve a small replacement image instead, but that still uses bandwidth and can look like vandalism on someone else’s page; a plain refusal is simpler. Many hosting panels also have a “hotlink protection” option that writes similar rules for you.

How to block hotlinking on Nginx

Nginx has a built-in directive for this. In the server block of your site:

none allows requests without a referrer, blocked allows referrers that a proxy or firewall has stripped, and server_names allows your own host names. Add other legitimate domains to the list. Make sure this location block does not replace caching headers you already set for images; combine them in one block if needed.

How to test your rule

A hotlink rule that is slightly wrong can break your own website, so test it straight after enabling it. With curl you can send any referrer you like:

  1. Foreign referrer: curl -I -e https://other-site.example/ https://yourshop.com/images/logo.png should return 403.
  2. Your own domain: the same command with -e https://yourshop.com/ should return 200. Try the www and non-www versions.
  3. No referrer: the command without -e should return 200.
  4. Search engine: a referrer such as https://www.google.com/ should return 200.

Then open a few pages of your site in a private browser window and check that every image loads, including images in the shop, the blog and any page builder sections. Look at the browser console for blocked requests. Finally, share one of your pages in a messenger or social network and confirm that the preview image still appears.

Remember caches. A CDN or browser may have stored a 403 response during testing, or still serve images that should now be blocked. Purge the CDN cache for image files after changing the rule, and repeat the tests. If you later add a new domain, such as a country site that uses images from the main shop, add it to the allowed list before launch.

Hotlink protection with a CDN

If your images are served through a CDN, configure protection there, because requests may never reach your server. Most CDNs offer a hotlink protection toggle or a rule based on the referrer header. The same exceptions apply: allow empty referrers, your domains and search engines. Check which file types the setting covers and whether it applies to your image CDN or only to the main domain. Our article on whether you need a CDN explains how CDNs handle images and bandwidth in general.

Some CDNs and image services also support signed or expiring URLs. These are useful for paid downloads, private documents and videos, where a simple referrer check is not strong enough, because the referrer header can be faked by anyone who wants to.

When hotlinking is not the real problem

Hotlink protection limits who can embed your files, but it does not stop copying. Anyone can download an image and upload it elsewhere. If the issue is stolen content rather than bandwidth:

Also look at your own image sizes. Serving images that are much larger than needed makes hotlinking more expensive and slows your own pages. Our guide to image optimization shows how to reduce file sizes.

How Site AI Audit helps

Site AI Audit does not check who embeds your images, but it reports several things that decide how much a hotlink costs you: how heavy your home page is, whether text files are compressed, how long your server takes to respond and Google PageSpeed results for mobile, together with security headers and the SSL certificate. You can run a free check, and the pricing page lists the plans with monitoring.

Related reading

The bottom line

Hotlinking lets other sites show your files at your expense. Check your logs or CDN statistics for foreign referrers, then block image requests from unknown sites with a referrer rule in Apache, Nginx or your CDN. Always allow empty referrers, your own domains and search engines, and test image search and link previews afterwards. For truly valuable files use signed URLs, and for stolen content use takedown requests rather than technical tricks.

FAQ

Does blocking hotlinking hurt SEO?

Not if you allow search engines and empty referrers. A rule that blocks image search result pages can remove your images from image search, so test after enabling it.

Can someone bypass hotlink protection?

Yes. The referrer header can be removed or faked, and anyone can download and re-upload your image. Protection stops casual embedding, not determined copying.

Should I show a replacement image to hotlinkers?

You can, but it still uses some bandwidth and may cause disputes. Returning 403 Forbidden is simpler and clearer.

Will link previews on social networks still work?

Usually yes, because platforms fetch the image on their own servers, often without a referrer. Test a few links after enabling protection.

Is hotlinking illegal?

Embedding someone else’s images without permission can infringe copyright depending on the country and context. Technical protection and takedown notices are the practical tools for site owners.

#Image optimization#Web hosting#Website security
अपनी वेबसाइट जाँचें — मुफ़्त।आपकी वेबसाइट में क्या ठीक करना है — और शुरुआत कहाँ से करें।
मुफ़्त शुरू करें

ब्लॉग से और

सभी लेख →
Internet Solutions

हमारी टीम के और प्रोडक्ट

Internet Solutions द्वारा बनाए गए। हमारे बाकी प्रोडक्ट भी आज़माएँ — हर एक अलग तरीके से आपका समय बचाता है।

internet-solutions.net ↗
01सोशल मीडिया ऑटो-पोस्टिंग
PostRSS

आपकी RSS फ़ीड की नई पोस्ट अपने-आप Facebook, X, LinkedIn, Telegram और 60+ अन्य नेटवर्क पर पहुँच जाती हैं।

मुफ़्त प्लान · 2014 सेदेखें →
02वेबसाइटों के लिए AI लाइव चैट
Talkmio

आपकी वेबसाइट आपके अपने कंटेंट से, विज़िटर की भाषा में, 24/7 जवाब देती है।

मुफ़्त प्लान · कार्ड की ज़रूरत नहींदेखें →
03AI असिस्टेंट
Ask Mio

चैट, कोड, डिज़ाइन, लेखन और रिसर्च। Mio हर काम के लिए सबसे अच्छा मॉडल चुनता है।

मुफ़्त प्लानदेखें →
04ब्लॉग और सोशल मीडिया के लिए AI ऑटोपायलट
AI Blog Autopilot

AI 2,000–3,000 शब्दों के SEO लेख लिखता है और हर लेख को 58+ सोशल नेटवर्क पर शेयर करता है।

पहले 3 लेख मुफ़्तदेखें →
05गहन SEO क्रॉल
Site SEO AI Audit

7 क्षेत्रों में पूरा SEO क्रॉल, AI सर्च में दृश्यता सहित, असर के हिसाब से क्रमबद्ध सुधारों के साथ।

पहला ऑडिट मुफ़्तदेखें →
06RSS और प्रोडक्ट फ़ीड
RSS Feed Creator

किसी भी वेब पेज से RSS बनाएँ, साथ ही Google और Meta के लिए अपने-आप अपडेट होने वाली प्रोडक्ट फ़ीड।

मुफ़्त प्लानदेखें →
07वेब डेवलपमेंट और SEO
Internet Solutions

वेबसाइटें, ई-शॉप और कस्टम सिस्टम — हमारी टीम डिज़ाइन करती है, बनाती है और चलाती है।

2011 सेदेखें →