Help In Linux

Linux Technical Blog
February 21, 2011

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

Reference: http.apache.org

Thank you for viewing helpinlinux.com

1 Comment to “hotlink protection in apache server”

Leave a Comment



Protected by WP Anti Spam