Not signed in (Sign In)

Categories

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorLuisPMA
    • CommentTimeAug 28th 2008
     
    Hey guys

    I know that some of you have figured out a way to stop hotlinking of your .mp3 files. I need to do that! One file in particular is being hotlinked the fuck out -- an average of 15GIGABYTES A DAY. Needless to say, I need this to stop asap!

    I know that its some sort of mod rewrite on the .htaccess file. But I run wordpress on my server. Unfortunately I suck at .htaccess files, so any tips would be GREAT!

    I don't use cPanel (I'm hosted at mediatemple.net if that helps any?); I think cPanel has a one-two-click feature to stop hotlinking -- I cant find ANY hotlinking articles on MediaTemple's support files. So I'm stuck with the old fashioned way.

    Any help is appreciated! Thanks!
    •  
      CommentAuthorSongbyToad
    • CommentTimeAug 28th 2008 edited
     
    The excellent Loudersoft posted this a little while ago when this came up:

    You need to configure the .htaccess file in your music directory to send nasty hotlinkers to the redirect.  Here's that code, fix as need be --

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourwebsite.com(/)?.*$     [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?someotherwebsitethatcanhotlinktoyou.org(/)?.*$     [NC]
    RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3)$ http://yourwebsite.com/redirect.html [R,NC]
    Just copy and paste that into a text file, renaming the URLs as appropriate, and then drop the file into the directory where you keep your mp3s.  Then change the file's name, including the file extension to .htaccess and you're sorted.  I redirect people to a special redirect page that explains why they're there and hopefully might even tempt some of them to read my site.  That way I stand half a chance of getting something out of the whole thing.

    http://songbytoad.com/2007/06/24/redirect/
    • CommentAuthorLuisPMA
    • CommentTimeAug 28th 2008
     
    you're magical.

    I see that you use wordpress. I upload my files via wordpress, so I would just add it to the wp-content/uploads folder, right
    • CommentAuthorLuisPMA
    • CommentTimeAug 28th 2008 edited
     
    uh oh... I created the .htaccess file with this in it:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?prettymuchamazing.com(/)?.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mossipblog.com(/)?.*$ [NC]
    RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3)$ http://prettymuchamazing.com/about/hotlinking-isnt-nice-dude/ [R,NC]


    and uploaded to my wp-content/uploads directory and now all my hosted files are giving me 500 Internal Server Errors.


    I've cleared my cache a few times to make sure, error persists. What did I do wrong?

    PS: I deleted the .htaccess so my images/mp3s can work, but i still want to stop mp3 hotlinking

    •  
      CommentAuthorSongbyToad
    • CommentTimeAug 28th 2008
     
    Hmm, no idea.  Unfortunately I know fuck all about coding, but I basically did what you did, as far as I remember, and it worked for me.  Does the Wordpress uploads folder have subdirectories in it, because that might be the problem, but that's just a wild guess. 

    I love the redirect page - that picture is hilarious.
  1.  
    it's too ironic that the # 1 pirate blog on the net is complaining about someone stealing his bandwidth
    • CommentAuthorchengy
    • CommentTimeAug 28th 2008
     
    Hmm I should experiment with the code and just have all the hotlinking mp3s re-direct to my front page. Probably would increase traffic.
    • CommentAuthorchengy
    • CommentTimeAug 28th 2008
     
    Luis,  did you just create an .htaccess file? If not, paste Loudersoft's code into the original .htaccess that is either in your root directory or /wordpress directory (if you named it something else). Your htaccess needs to have its original contents and the new file overrides it which is probably causing the error.
    • CommentAuthorLuisPMA
    • CommentTimeAug 28th 2008
     
    it's too ironic that the # 1 pirate blog on the net is complaining about someone stealing his bandwidth

    uhh... anyway...??


    Does the Wordpress uploads folder have subdirectories in it, because that might be the problem, but that's just a wild guess.

    it does! its split up by year "2007," "2008," yadda yadda.

    Luis, did you just create an .htaccess file? If not, paste Loudersoft's code into the original .htaccess that is either in your root directory or /wordpress directory (if you named it something else). Your htaccess needs to have its original contents and the new file overrides it which is probably causing the error.

    well Wordpress creates an .htaccess file onto the wordpress directory (in my case root dir) automatically... so what you're saying is that I have to add the contents of that .htaccess file into my other .htaccessfile in my mp3 directory?

    thanks for the tips, I will give them all a try and see what works!

    • CommentAuthorLuisPMA
    • CommentTimeAug 28th 2008
     

    Hmm I should experiment with the code and just have all the hotlinking mp3s re-direct to my front page. Probably would increase traffic.


    thats genius! hahaha
    •  
      CommentAuthorunderthedog
    • CommentTimeAug 28th 2008 edited
     
    It's very possible to do what Allan is describing.

    I'm trying to find my htaccess file but since I run about 15 domains on my server and they all run off of one htaccess file I can't remember where it is...
  2.  
    Hey Luis, I found a htacess generator.... much easier then poking around my server and then reading the code:)

    http://www.htmlbasix.com/disablehotlinking.shtml
    • CommentAuthorLuisPMA
    • CommentTimeAug 28th 2008 edited
     
    thanks guys! I finally said, "screw it," and went to a (wordpress only) higher power. works like a charm.
  3.  
    you could also make it re-direct to rick astley. Or an mp3 of porn noises...
  4.  
    this has nothing to do with coding, but one way we got kids to stop hotlinking old pictures was by replacing them with graphics that said, "JESUS LOVE YOU!!!!" then replacing the pics in the original posts with new ones with different names.
    • CommentAuthorLuisPMA
    • CommentTimeAug 29th 2008
     
    haha.. OR you can do the coding, and it could do all that for you
    •  
      CommentAuthorloudersoft
    • CommentTimeAug 29th 2008
     
    I vote for a special 404 featuring tubgirl, pain.jpg and goatse man all in rotation
    • CommentAuthorchengy
    • CommentTimeAug 29th 2008
     
    Hmm I don't want to be the guy who makes that. How about I nominate you loudersoft to do that for us? :P
    •  
      CommentAuthorloudersoft
    • CommentTimeAug 29th 2008
     
    I am unable to accept this nomination
    •  
      CommentAuthorSongbyToad
    • CommentTimeAug 29th 2008
     
    You'd end up on all sorts of FBI lists, so best not!