Admin-Ahead Community

Linux => General Linux => Topic started by: nirmal on November 17, 2013, 06:13:27 pm

Title: Hotlink protection in apache server
Post by: nirmal on November 17, 2013, 06:13:27 pm
Hi Guys,

Hotlink protection in apache server
-----------------------------------------
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