You Don't...
But your problem is easy, Put all the files in one folder that you want to protect, and the ones that are free access in another folder, then just put the .htaccess in the protected folder, it will protect it and all sub folders but not affect the other folders outside of it. ie
protected
/home/user/html/web/protected/ (put .htaccess here)
Not protected
/home/user/html/web/free_files/
This is what I use for code and it works very well:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^$ [OR]
RewriteCond %{HTTP_REFERER} !^
http://www.gofuckyourself.com/ [NC]
RewriteCond %{HTTP_REFERER} !^
http://gofuckyourself.com/ [NC]
RewriteRule /*
http://www.gofuckyourself.com/fuckoff.html [R,L]
Hope this helps.
Regards
Burnie
