Script Pulse

Trade Pulse => Trade Pulse Support => Topic started by: Cool Guy on September 16, 2011, 04:25:10 PM

Title: Redirect incoming traffic from certain site to another url (different site)
Post by: Cool Guy on September 16, 2011, 04:25:10 PM
So I want to do this and I read about .htaccess and related topics. But I don't want to send visitors to different face, I need to send them to different web site. So maybe there is a way to do this?
Title: Re: Redirect incoming traffic from certain site to another url (different site)
Post by: ip0li on September 17, 2011, 08:13:41 AM
There is no way to do this inside TP, I would do it with custom php couple lines of code on index.
Title: Re: Redirect incoming traffic from certain site to another url (different site)
Post by: Cool Guy on September 17, 2011, 08:34:44 AM
I did this with:
<?php
$referrer = $_SERVER['HTTP_REFERER'];
if (preg_match("/top.nonude.me/",$referrer)) {
    header('Location: http://xxxx');
};
?>
works fine, but will these hits be counted by trade pulse (as that php code is at very top of header.php)
Title: Re: Redirect incoming traffic from certain site to another url (different site)
Post by: Kildoozer on September 17, 2011, 10:27:03 PM
It will be counted if you'll send it through the tp's out.php, like header('Location: /tp/out.php?to=xxxx.com'); or header('Location: /tp/out.php?for=xxxx.com&url=http://xxxxx.com/any_page_goes_here');
Title: Re: Redirect incoming traffic from certain site to another url (different site)
Post by: ip0li on September 18, 2011, 04:22:11 AM
No, they will not get counted since redirection is before ssi_in.php include.

You can make them count by instead of this redirect place javascript top.location redirect below ssi_in.php but again clicks in that case wont be counted and that ref url will get very low return of traffic.