myspace is not my space, which isn’t your space

I was browsing through my weblogs over the weekend, and discovered that my bandwidth use is waaaaaaaaaay up. Most of it comes from a clip of the Drew Carey show where Richard Simmons plays the part of various props. It’s one of those clips that brings tears to your eyes, so I’ll share for a little while longer, then change the URL in a day or so.

The other area that it comes from is people who use myspace and a few forums hotlinking to images as part of their sig. I have no problems with folks downloading and hosting them elsewhere (and with all the free image hosting services, there’s no reason why they can’t), but don’t use my fircking bandwidth. It’s a common problem, unfortunately.

Thankfully, apache’s rewrite rules makes dealing with the large majority of the requests originating from myspace pretty straightforward. If the browser sends a referrer (very few don’t, although programs like Norton Internet Security block them by default) from a myspace hostname, they’ll get a different image than what their browser requested.

Some folks use an image that is somewhat distasteful to punish hotlinkers, but I figure a simple message is more effective, and the image they get is only 900-odd bytes. (plus the image itself makes them look funny in their forums, because their sig is supposed to be an expression about them). Once they clue in, they usually change things pdq.

A little thing to be true, but I feel better about it.

The rewrite rule, in case you were wondering, is a whole two lines:

RewriteCond %{HTTP_REFERER} ^http://([^/]+)myspace\.com/.*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ /images/leech.gif [L]

Update: If you’re hosting your site on Apache using a provider, you can usually add rewrite rules using .htaccess files. JavaScript Kit provides a well-written overview on .htaccess, which includes a section on blocking access by referrers. Have a look-see, as it’s a great starting point for understanding how this stuff works, and what you can do to control how Apache handles page requests with your site.

7 thoughts on “myspace is not my space, which isn’t your space

  1. But Kev, you could have so much fun with this!

    I agree that a distasteful image would be bad, but if it’s myspace people, then you could take advantage of the type of people who use the site.

    So instead of

    “I steal bandwidth”

    how about
    “I think new Metallica is good”

    or

    “I love me some Quiet Riot”

    or

    “I listen to Loverboy and wear red leather pants”

    you get the idea…

  2. Wow…dissing Metallica, Quiet Riot and Loverboy all in one comment. Yeh does not understand what it means to Party Hard. So sad.

    My favorite MySpace experience was when some moron signed up for an account and used one of my hotmail accounts for his info. I had me a good time. Still up, too.

  3. Oh but I’m not dissing any of them per se.

    I think old Metallica is great (Metallica is the new R.E.M. you know).

    And Quiet Riot is a great Slade cover band.

    And all of us in the industry work for the weekends.

    sniff.

    actually everybody…

    Everybody’s working for the weekend
    Everybody wants a little romance
    Everybody’s goin’ off the deep end
    Everybody needs a second chance, oh
    You want a piece of my heart
    You better start from start
    You wanna be in the show
    Come on baby lets go

    Kev’s blog now violates some sort of copyright law.

  4. Hi there,

    Found you when doing a search on “punishing hotlinkers”. I’m looking for a similar solution but I don’t have access to my web server. I don’t think the Apache rewrite rule will work for me. All I see on my control panel is “apache handlers”.

    Anyway, just wanted to commiserate. Nice blog you got here. I like the color theme. 😀

    Trish
    aka greenfreak

  5. Just to follow up on Trish’s note, there’s a well written reference/tutorial for for blocking sites using .htaccess, which is how most people using a hosting provider (it must be Apache, based, though) would enable these rules. The tutorial is well-written, and is a great starting point.

    And Helly, since it was just a monkey typing in a random sequence of letters from MA, I am sure I could argue that it’s not a copyright violation. Mike Reno still wearing those red leather pants, now that’d be a violation (but just of taste).

Leave a Reply

Your email address will not be published.