Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

does this 301 work for google

using php

         

lisa2005

3:15 pm on Apr 16, 2006 (gmt 0)

10+ Year Member



will this 301 redirect work for google?
<?
header("HTTP/1.1 301 Moved Permanently");
header("Location: [mydomain.com...]
exit();
?>

this should be exactly the same as using htaccess.

encyclo

1:53 am on Apr 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The spider will only see the end result not the code used to produce it, so yes the above will have the same effect as any other 301 Permanent Redirect.

lisa2005

2:16 am on Apr 17, 2006 (gmt 0)

10+ Year Member



great!,

so all webmasters who give out affiliate cash, you will have to do the following to prevent affiliate cache pages showing up and your mainpage not getting the necessary backlink pageranks.

let's say your affiliate point to you like this:

yourdomain.com/?aff_id=#*$!xx

your index.php page will first need to do this:

<?
if ($_GET[aff_id]) {
$_SESSION[aff_id] = $_GET[aff_id];
// then do your database stuff and cookie stuff here as well to count the clickthrough if you do that
header("HTTP/1.1 301 Moved Permanently");
header("Location: [yourdomain.com...]
exit();
}
?>

you have to have this on top of your page before any output is performed.