Open /etc/squid/squid.conf in your editor
Go to section Access Controls...
Add this
Code:
acl blocksites dstdomain .rapidshare.com
http_access deny blocksites
Save, restart.
As far as blocking torrents,.. It doesn't seem possible in my mind. Someone far smarter than me might say differently.