HTTP (and HTTPS as well) has a referral header. This header allows the log analyzers to trace where the request is coming from. So, if you need to stop external referrals, this is the way to do it.

Here it is my .htaccess file I use:

RewriteBase /
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?inside-out.xyz/.*$ [NC]
RewriteRule .(gif|jpg|swf|flv|png)$ http://inside-out.xyz/1px.gif [R=302,L]

This will deliver the file 1px.gif to all queries who are coming outside of inside-out.xyz domain.

Please take in mind that this can backfire, and it depends on your environment to use it or not. It can save you lot of bandwidth (which it protects your availability), but it can harm your SEO.

Enjoy!

blog comments powered by Disqus