you're barking up the wrong tree.
.htaccess is a file you place on your webspace that contains rules for the webserver to act on, such as blocking sites, blocking access, redirecting, etc.
referral spam is when sites actually use their own site as a referer to yours, so they show up in your most recent referals list, usually on blogs or stats pages. most of these sites are for porn or medical/drug sites.