Jump to content

Getting the Referring site


monkeytooth

Recommended Posts

Not sure this is the direction I want to take per say with what I have in mind. Currently I have about 25 domains being redirected towards my main domain. What I have for those domains is a simple setup where I just plugged a simple single line php based header location style redirect. so if you go to domain5.com it will redirect and go to domain.com I set it up this way as I do have plans for these domains one day but not at the moment and rather than have them sitting there doing nothing I figured might as well just point them somewhere for now. With that I want to try and keep a hit count on which domain is bringing in traffic (if any) nothing fancy. I figured i'd do something as simple as grab the URL from the referencing domain. check it against a database table and if that domains in my table then +1 on the hits.

 

My problem is however I try

echo $_SERVER['HTTP_REFERER'];

and I get "Undefined index: HTTP_REFERER" as an error. Then after a little reading about it I find HTTP_REFERER isn't a definitive solution as its user agent based so if the user agent doesnt set it then I don't get it.

 

So in all I guess is whats the best way to approach finding what domain is coming to my main domain. I also want to use this with google, yahoo, bing and other systems of the like to see if I am getting any hits from them either. Would be nice to see what the keywords are to but im not gonna push my luck at the moment, currently I just want what .com, net, org, other is coming to my site thats it more is a plus but not going to whine if i dont get that right now.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.