So you've got your blog all set up, you've been publishing for a while, and all of a sudden you learn that people have been "hotlinking" to your images. This outrages you, so you set up an .htaccess rule to replace any "hotlinked" images with a graphic that says "Stealing Images Makes You A Jerk!"
That ought to teach those jerks for stealing your images... right? Sure it will, but I've got a question for you: Do you have an RSS feed?
Oh, you do?
Well, you've also just prevented all those "jerks" who subscribe to your feed from "stealing" your images too. Wait, you want them to be able to see your images? Of course you do.
The trick is to set up your .htaccess file to allow certain websites to be able to display your images, while blocking everyone else. You'd do it by making your .htaccess file look something like this:
What that does is look to see if your image is being loaded from some other website. If it is it then checks to see if that website is one of the "approved" ones. If the site in question is in the list, the image is displayed normally -- but if it's not, your "Do Not Steal" graphic gets displayed instead.
That list is all of the online RSS aggregators I know of. If you want to add your friend's site to your approved list, just copy one of the lines up there, substituting in the proper domain name. Don't include the "www," because that little "(.*)?" will match that if it's there.
If you use a reader that's not in that list, let me know so I can update the list here.
Here's a nifty little .htaccess file trick for all you who are taking advantage of web hosting:
So you use Gravatar and want to include yours in things that you make later on, but either hate having to look up the big long encrypted gibberish string associated with your image, or didn't even know you could do that?
First off, take a look at your gravatar image in your browser. Rightclick on it and select 'view image'. Then copy the entire contents of the url bar (mine is 'http://www.gravatar.com/avatar.php?gravatar_id=bb2e88bec80c451b7300b0bff1b7ba1b', yours should be the same but with different gibberish at the end) so you can paste it later.
Simply add the following to your .htaccess file and things will be much simpler:
replacing my gravatar url with yours, and you'll be able to use it by simply referring to 'yourdomainname.com/gravatar.png'.
As you change your gravatar image, any page that includes 'yourdomainname.com/gravatar.png' will be automagically updated with the new image. This could be helpful for including in forum posts, blog comments, etc -- really anyplace that doesn't currently take advantage of gravatar, but you wish it did.
I was just looking through my referral stats, and found that I've been getting some hits from some random person's MySpace page. I headed on over there to see what was what and found that she was using the crappy Natalie Portman mohawk pic as a tiled background on her site.
See, this picture of Natalie Portman's bald head has accounted for over 32% of all my traffic in the last week. I don't want to disable the ability for people to link directly to the things I post, but I have to say that this irks me just a tad. It isn't even a good picture! I posted a much better one, they should be linking to that.
In any case, I've decided to replace that image with something hilarious that might make viewers question the morality of the person posting the image. Any suggestions? I'm currently leaning towards this: