htaccess detecting direct visit or referral

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
dwighttttt
Forum Newbie
Posts: 2
Joined: Wed Nov 22, 2006 4:39 pm

htaccess detecting direct visit or referral

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
Post Reply