Disable hotlinking generator
- Fill in the form below to see a plain-English summary here.
About hotlink protection
Hotlinking is when another site displays your images (or other files) directly from your server instead of copying them to their own - every visitor who loads their page also downloads the file from yours, using up your bandwidth for someone else's content. This tool builds a .htaccess rule, using Apache's mod_rewrite, that checks the Referer header on each request and blocks (or, in allow mode, permits) file requests based on which site they came from.
A few notes on using it: enter domains without the protocol or www. - the generated code accounts for both automatically. In "allow" mode, always include your own domain, or your own pages will stop being able to show your own images. Placing the .htaccess file in your domain's root folder protects every folder underneath it; if images are also linked to from a subdomain you control, add that subdomain to the list too. This rule set relies on Apache/mod_rewrite and will not work on a Windows server.
Frequently asked questions
Will this block my own website too?
Only if you forget to add it. In "allow" mode, add your own domain to the URL list so your own pages can still load your images - the rule blocks everyone except what's on the list. In "block" mode you don't need to add your own domain at all, since only the sites/agents you list are blocked.
What's the difference between "allow" and "block" mode?
"Allow" mode is the safer default: only the sites and search engines/social platforms you list can load your files, everyone else is blocked. "Block" mode is the opposite: everyone can hotlink except the specific sites/agents you list - useful if you only know of one or two sites stealing your bandwidth.
Should I block blank referrers?
Only as a last resort. Some browsers, privacy tools, and direct file requests (like music or PDF links) don't send referrer information at all, so blocking blank referrers can also block legitimate visitors. Try it without blocking blank referrers first.
Does this stop hotlinking of videos or PDFs, not just images?
Yes - list whatever file extensions you want protected (e.g. mp4, pdf, mp3) in the file extensions field, not just image formats. Enter * to block hotlinking of every file type in the folder.
Can my "replacement image" get blocked too, causing a loop?
Yes, if it shares a risk factor with what you're blocking - either its own domain is caught by your rule (on the blocked list in "block" mode, or missing from the allow list in "allow" mode), or its file extension is also one you've blocked. Either one on its own is enough to send a blocked visitor's browser back through the same rule when it tries to load the replacement, which is what causes the loop. This generator checks both live and warns you above if either applies - the simplest fix is usually giving the replacement file an extension you haven't blocked (e.g. rename a .jpg to .jpe).
