Sorry I haven’t been posting lately guys. I got lots of pretty damn good excuses for it but I’ll spare you of having to hear them. This week I’m back on the ball and I’m going to attempt to up my post volume to make up for the slack the last week and a half.

Today’s post is a detailed way to deal with pesky hotlinkers. Hotlinkers are people who use your binary content and instead of hosting it themselves they just link directly to it on their site. I saw a funny article awhile back about a guy who threatened to sue another webmaster for removing the images he was hotlinking to on his server. That’s pretty funny stuff for anyone with half a brain, but there must of been a better way for the victim to get his rewards from the hotlinker instead of having to rename or remove the images. So true to tradition here at Blue Hat we’re going to look at some simple ways to not only stop them from hotlinking to your material but to try to get some of their visitors out of it as well. Personally I see hotlinking as a compliment. It means you have quality content. However there in lies the opportunity. If they are hotlinking to your content then their visitors must be of the similiar niche as yours. So I see no moral dilemma in trying to grab some of their visitors while politely letting them know that you don’t appreciate them sucking up your bandwidth. Let’s look at a few media formats and determine some ways to draw their visitors to your site using your .htaccess file. If you don’t know what a .htaccess file is please go here and do some reading.

Images
Images are the most commonly hotlinked to content so lets tackle them first. The trick here is to simply replace the image they are hotlinking to with an image that advertises your website. So make an image saying something like, “Go To www.MyDomain.com To View This Image.” Then name the file hotlinked.jpg and upload it to your server.
Then add this to your .htaccess file
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mydomain.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ hotlinked.jpg [R,NC]

Flash Files
You have two options with flash. You could use the same method as the images and show a different flash file that displays an ad for your site. A more aggressive option might be to use the getURL() method inside the flash file and have it actually forward the user to your site. So your essentially hijacking any hotlinkers site or dare I say Myspace page. Create this file and name it hotlinked.swf then put this in your .htaccess file.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mydomain.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com$ [NC]
RewriteRule [^hotlinked].(swf)$ http://www.mydomain.com/hotlinked.swf [R,NC]

Music
Sometimes sites users from MyPlaylist.org, Musiclist.us, and other sites will jack your mp3 files for their myspace pages and other sites. So its not a bad idea to have some fun and create a short audio advertisement for your site and put it into an mp3 file called hotlinked.mp3 then put this in your .htaccess file.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mydomain.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com$ [NC]
RewriteRule [^hotlinked].(mp3)$ http://www.mydomain.com/hotlinked.mp3 [R,NC]