Posted 29 May 2006 - 11:14 AM
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!
Posted 29 May 2006 - 12:15 PM
Posted 29 May 2006 - 12:37 PM
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...
The latter, I don't want to block - just want to redirect from certain referrers.
Posted 29 May 2006 - 01:20 PM
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...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users