This can be accomplished with a combination of SetEnvIf and the Deny and Allow directives. However, it is important to understand that any access restriction based on the REFERER header is intrinsically problematic due to the fact that browsers can send an incorrect REFERER, either because they want to circumvent your restriction or simply because they don’t send the right thing (or anything at all).
The following configuration will produce the desired effect if the browser passes correct REFERER headers.
SetEnvIf REFERER "www\.mydomain\.com" linked_from_here SetEnvIf REFERER "^$" linked_from_here Order deny,allow Deny from all Allow from env=linked_from_here
Thank you for viewing helpinlinux.com