Block Hotlinking using htaccess

By the following code you can prevent access of the image, js and css file and so on. when some one use the resources (image,js,css etc) of your website, it is cause the bandwidth issue and stealing the data.

RewriteEngine on
RewriteCond % !^$
RewriteCond % !^http://(www.)?example.com/.*$ [NC]
RewriteRule .(gif|jpg|jpeg|png|js|css)$ - [F]