[geeklog-devtalk] portal.php and search engines

Matthew Cox geeklog.net at coxjunk.com
Mon Sep 13 15:14:15 EDT 2004


Dirk,


>>I changed my portal.php status to 301. We'll see which works better.

>>301 or 303.

>

> Any success?

According to my logs google and yahoo have not respidered the offending
link yet. I'll let you know when it does. Google is showing it correctly
but yahoo is still showing my url with the links content. Compare google
and yahoo searchs for "soquili center"

What was your search phrase for your link problem again?


> My experiments seem to indicate that Google doesn't differentiate between

> 302 and 303. The Googlebot received 303s now for all the links on the

> site and still doesn't treat them differently than with the 302.

Well there's one more thing to rule out.


> I'm switching to 301s now to see if that makes a difference. The option

> of excluding portal.php in a robots.txt more and more looks like the way

> to go, though.

If you exclude portal.php in robots.txt then your site will no longer give
page ranking points to any of those links. I think you run the risk of
hurting the target pages rank. I would do that as a last resort.


>>The question is will be which one gives better page ranking

>>points to the link.

>

> The link in question currently is in the #1 spot ...

As I said above, excluding in portal.php could adversely affect this #
spot ranking.

I also took a look at my code for portal.php. I hacked mine awhile ago
from the meta refresh method to header location. I noticed that my code
is slightly different from the the latest 1.3.9sr1. Since google is now
treating my link correctly under this hack I thought you might like a
look. My offending portal link has not been spidered since I added the
header 301 line, so google seemed to correct the url problem with only the
use of the Location line instead of meta refresh. I can't see why the
1.3.9sr1 version would be treated different though. Maybe you can see
something in the code I can't.
/////////////////////////////////////////////////////////
// $Id: portal.php,v 1.10 2002/12/03 13:45:26 dhaun Exp $
// Hacked 1.3.8-1sr3 portal.php by Matthew Cox
require_once('lib-common.php');

// MAIN

$display = '';

if (!empty($item)) {
$url = DB_getItem ($_TABLES['links'], 'url', "lid = '{$item}'");
DB_change($_TABLES['links'],'hits','hits + 1','lid',$item,'',true);
// $display .= COM_refresh($url);
$display .= $url;
} else {
// $display .= COM_refresh($_CONF['site_url']);
$display .= ($_CONF['site_url']);
}

// echo $display;
header('HTTP/1.1 301 Moved Permanently');
header("Location: $display");
/////////////////////////////////////////////////////////

Without the header 301 line google seemed to interpret correctly. I'm
hoping the 301 will fix yahoo once it gets spidered.

Lastly, I'm using the email I used to subscribe to devtalk so hopefully
you don't have to approve this message manually. Let me know if you do.

-Matthew
matthewcox.org



More information about the geeklog-devtalk mailing list