Main Menu
All times are in GMT -7 (DST) :: The time is now 10:15 pm.
Sub Menu
Knowledgebase Sections
Article Data
- Article Ref
- 1834-IOJV-8560
- Written By
- Quinn Whipple
- Date Created
- Wed, 5th Aug 2009
- Date Modified
- Wed, 13th Apr 2011
Article Actions
Referrer Filtering
Question
How do I filter access to cgi-bin or other subdirectories based on the website referrer.
Answer
Here is an .htaccess directive that will allow you to filter requests to whatever sub-directory you put it in. This directive will also effectively stop any hotlinking to your site.
SetEnvIfNoCase Referer "^http://yourdomain\.com/" good_referer=1
order allow,deny
allow from env=good_referer
OnDeny http://yourdomain.com/warningpage.htm
- In this example you are specifying yourdomain as the only referrer that can access the directory that this .htaccess directive is in.
- 'http://yourdomain.com/warningpage.htm' is the path to your declined screen, you can set this to whatever you want.
- If you need help creating or using an .htaccess file please refer to this article.
Article Comments
There are currently no comments.



