gravatar .htaccess

Jul 03, 2006 11:17


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:RewriteEngine On
RewriteBase /

RewriteRule gravatar.png http://www.gravatar.com/avatar.php?gravatar_id=bb2e88bec80c451b7300b0bff1b7ba1b

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.

Previous post Next post
Up