Damn hotlinkers...

Status
Not open for further replies.

logiik

321
Aug 7, 2006
268
6
0
Ok here is the stats to a small music blog that I run:

2m2upnp.png


Most of that traffic comes from people that hotlink the mp3 files to use on their flash players for MySpace and shit like that.

See:
2hoxloh.png


Does anyone know an easy way to redirect all that traffic back to my site? LOL :)
 


I don't think you can redirect it back to your site, unless they link directly to the MP3, however you can block the hotlinkers completely with a bit of .htaccess magic. :)
 
Sell your blog to an affiliate company and they can countersue myspace for stealing bandwidth!
 
I have no idea if this actually works, i just whipped it up and haven't done any tests yet. but i'm thinking you could check for the referrer through your htaccess file. If it doesn't come from a direct request or from your domain than redirect it to a seperate flash file. Inside that flash file have it automatically open up your url(either as a redirect or as a popup, i dont' know much about flash).

Inside the 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 .*\.(swf)$ http://www.mydomain.com/bad.swf [R,NC]
Let me know if you get this working because i'm interested to. :)
 
  • Like
Reactions: MisterX
i'm thinking you could check for the referrer through your htaccess file. If it doesn't come from a direct request or from your domain than redirect it to a seperate flash file. Inside that flash file have it automatically open up your url(either as a redirect or as a popup, i dont' know much about flash).:)

Good thinking!!!

Even if it doesn't work, it's still a damn cool idea.
 
if you have control over the box you can do some fun stuff with php...

just use .htaccess to rewrite the file to a php script which you can send header() functions through.

You can also check for referer like myspace

Sure, that'd work if they executed your file on each page load, but from the sound of it there's flash files streaming his MP3 through them. Meaning inside that SWF file, they try to open the MP3, read it, and play it.

If you map the MP3 filename to a PHP file, and change headers, the only thing that'll happen is the flash file won't be able to stream the music.

Under those circumstances, it's not possible to forcefully redirect those visitors to your blog. Sorry. :D
 
Figured it out

Here's the 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 [^bad].(swf)$ http://www.mydomain.com/bad.swf [R,NC]
This will take any sites that hotlink to your swf files and instead display bad.swf. bad.swf is where you will put your code that will open your url into the _top target. This can be easily done through getURL(How To: Macromedia Flash - ActionScript Dictionary : getURL) .Essentially hijacking any page that hotlinks to your flash.

If you would like to instead redirect them to an image
put this instead of the other
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 .*\.(swf)$ http://www.mydomain.com/bad.jpg [R,NC]


Here is an example:

Handicap Helmet » Super Retarded Dog
It hotlinks to the superretardeddog.swf flashfile on some bullshit junk site.
but while its hotlinked on handicaphelmet it instead displays bad.swf which is the ever hilarious Fat Girls On Bicycles flash. Ie. whatever i put for bad.swf

The only downside to this is, since it checks the referer than it could screw up on your site depending on what the exact referer is. Its not a bad idea to check for referrers such as google which might screw it up.

Example for Google
RewriteCond %{HTTP_REFERER}!^http://w+\.google.*.* [NC]
Put that under the last RewriteCond line but before the rewriteRule line.
Another solution for this might be, instead of checking the referer to be your domain check for anythign coming from profile.myspace.com etc. That'll prevent screwups from outside referrers but it'll limit the hotlink protection to only hotlinks coming from myspace.

Thanks this thread just gave me some kick ass redirect injection ideas :)
 
If it is mp3's being played by Flash I think your best (only?) option is to redirect with .httaccess to another mp3 file that has audio "visit xxx.com, not this crappy stealing site".

I think Deli didn't understand the problem: SWFs are not being stolen, MP3 files are.

(it is also possible that I'm dumb.. well more negative rep for me then :) )
 
If it is mp3's being played by Flash I think your best (only?) option is to redirect with .httaccess to another mp3 file that has audio "visit xxx.com, not this crappy stealing site".

I think Deli didn't understand the problem: SWFs are not being stolen, MP3 files are.

I agree, that's what I've been saying this whole time. Haha
 
You're absolutely right i'm an idiot :)
Sorry it was like 4am when i responded. :)

yep should work just fine
just replace swf with mp3 in the code on the last post.

then record yourself an advertisement for your website, or babies screaming whatever.. and put that as bad.mp3


RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://www.musiclist.us$ [NC]
RewriteCond %{HTTP_REFERER} ^http://www.myplaylist.org$ [NC]
RewriteCond %{HTTP_REFERER} ^http://www.musicplaylist.us$ [NC]
RewriteCond %{HTTP_REFERER} ^http://www.projectplaylist.com$ [NC]
RewriteCond %{HTTP_REFERER} ^http://www.playahead.se$ [NC]
RewriteCond %{HTTP_REFERER} ^http://www.profileplaylist.net$ [NC]
RewriteCond %{HTTP_REFERER} ^http://www.profilemusic.org$ [NC]
RewriteCond %{HTTP_REFERER} ^http://profile.myspace.com$ [NC]
RewriteCond %{HTTP_REFERER} ^http://images.projectplaylist.com$ [NC]
RewriteCond %{HTTP_REFERER} ^http://www.myflashfetish.com$ [NC]

RewriteRule [^bad].(mp3)$ http://www.mydomain.com/bad.mp3 [R,NC]
You can put bad.mp3 as an advertisement to your site or you can put in any url to an mp3 file.
 
Status
Not open for further replies.