Jump to content

Referral Redirection


ModGirl

Recommended Posts

Hi [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

I've just started learning PHP, and while I'm beginning to get the hang of it. I've realised I need a script within my header.php file that redirects certain referrers back to where they've originated from as .htaccess just doesn't seem to be doing the trick at all.

I have done numerous searches on a tonne of forums and search engines and only came across redirection after login scripts. I don't wish to make my site membership at this time, so login scripts etc are useless to me.

Could someone please point me in the right direction?

Thanks in advance!

Moddy
Link to comment
Share on other sites

[!--quoteo(post=378051:date=May 29 2006, 01:15 PM:name=s_bastian)--][div class=\'quotetop\']QUOTE(s_bastian @ May 29 2006, 01:15 PM) [snapback]378051[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Do you need to block certain users (eg: web spiders) or the fact that someones links to your pages? referrers work on this latter case, but if you need to block spiders the best option is to work out a robots.txt for you site...
[/quote]

The latter, I don't want to block - just want to redirect from certain referrers.
Link to comment
Share on other sites

what you need to look at is $_SERVER['HTTP_REFERER']
this var states where connection comes from. You can put a filter that if referer is not internal or null the link is sent back. Or you can compile an array with a list of sites you want to "cut off", and then filter what can pass and what cannot.
You will then use the META REFRESH to redirect the page where you need, or an include() to load a warning page. Pay attention with a "total" filter, it will also block links coming from search engines result pages...
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.