[ciapug] Logging outgoing traffic while being crawler friendly
Lathrop Preston
ciapug@cialug.org
Thu, 29 May 2003 17:03:36 -0500
or have go.php do something like this
<?
//log the outlink
header("Location:".$golink);
?>
that should look like a link
I think
David Champion wrote:
> Could you maybe do something with either rewrite, or some kind of error
> handling, and make the link like:
>
> <a href="go/www.ames.ia.us">Go to the City of Ames site</a>
>
> ...then your magic thingy looks for anything after "go/" and redirects.
>
> -dc
>
> Claus wrote:
>
>> Hello
>>
>> I have a php redirect page that I use to redirect outgoing links
>> through. That way I can keep track of what links people use from my
>> site. Things work great with the exception that search engines /
>> crawlers don't account these links. So for instance the link to
>> /go.php?http://www.ames.ia.us will never get put into the "Find web
>> pages that link to www.ames.ia.us" list of google. That's because it
>> doesn't appear as a link.
>>
>> Is there another way that could do both, track outgoing links and be
>> crawler friendly?
>>
>> Thanks,
>> Claus
>>
>> ----Link----
>> <A HREF="/go.php?http://www.ames.ia.us"
>> onMouseOver="window.status='http://www.ames.ia.us'; return true"
>> onMouseOut="window.status=''; return true">
>> Ames City Government</A>
>>
>> ----Redirection/Logging Page----
>> <?php
>> $link = getenv('QUERY_STRING');
>>
>> if ($REMOTE_ADDR != 'insert my ip here' &&
>> $REMOTE_ADDR != 'insert my other ip here') {
>> require_once('DB.php');
>> $db = DB::connect('pgsql://www@unix+localhost/database');
>> if (DB::isError($db)) {die ($db->getMessage());}
>>
>> $result = $db->query("insert into web_stats_links_visited
>> (timestamp, server
>> _name, remote_ip, remote_name, url) values (current_timestamp,
>> '$SERVER_NAME', '
>> $REMOTE_ADDR', ' ', '$link')");
>> if (DB::isError($result)) {die ($result->getMessage());}
>> $db->disconnect();
>> }
>>
>> header("Location: " . $link);
>> exit;
>> ?>
>>
>> _______________________________________________
>> ciapug mailing list
>> ciapug@cialug.org
>> http://cialug.org/mailman/listinfo/ciapug
>>
>
>
> _______________________________________________
> ciapug mailing list
> ciapug@cialug.org
> http://cialug.org/mailman/listinfo/ciapug