Page 1 of 1

htaccess detecting direct visit or referral

Posted: Mon Dec 18, 2006 3:46 pm
by dwighttttt
is there anyway to detect whether a page has been hit directly or through a referral using htaccess? if not, any other ways?
i would need to check on any file type (images, zip, html, etc.).

hopefully i would like to perform the check, and in cases of referrals, redirect to another page.

thanks

dwight

Posted: Mon Dec 18, 2006 3:48 pm
by John Cartwright
How do you determine what a referal is? Do you provide them with a link?

http://yoursite.com/?refid=432, and detecting whether or not refid is set typically how it is done. Using this method you could use htaccess with a rewrite rule to capture the request.