Built in referer check of apache httpd | Just my blog

/dev/random

Built in referer check of apache httpd

Recently I found that it is possible to do a referer check within the Apache Webserver, so you don’t need any PHP-voodoo… :-D

All you need is the next few lines in your httpd.conf file:


SetEnvIfNoCase Referer "^http://www.example.com/" ownsite


<Directory "/usr/sites/www.example.com/pics">
Order deny,allow
Allow from env=ownsite
Deny from all
</Directory>


So other sites will receive a 403 forbidden message from you webserver if they try to link to a file in your pics map :-D


  • Social

  • By continuing to use the site, you agree to the use of cookies. more information

    The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible and enable advertising to provide you free content. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

    Close