Forum Moderators: phranque
Sorry for the delay in responding... We usually help with code that already exists, so sometimes general questions get missed.
You can do what you are asking through the use of a RewriteCondition. The site search has not been woring lately, so if you use one of the major search engines and search for RewriteCond {HTTP_REFERER} site:webmasterworld.com you should find a plethora of information relating to exactly what you need.
When you have something that is close, post that either here or in a new thread and one of us will help walk you through 'tweeking' it to your specific need.
Hope this helps.
Justin
Welcome to WebmasterWorld!
A second search for "HTTP_REFERER unreliable [google.com]" may lead you to some other information that you should be aware of.
Jim