Forum Moderators: open

Message Too Old, No Replies

Php redirect, will it upset google?

         

brakkar

6:19 pm on Mar 8, 2004 (gmt 0)

10+ Year Member



Hello, on a page of my site, I must put a redirect.

It seems i can't use an htaccess permanant redirect, so i've put a php redirct:

header( 'refresh: 0; url=http://www.mysite.com' );

Won't google consider it as cheating, abusing and doom my site for the rest of the century?

Just to know. Since this particular page will redirect to my frontpage, I don't want to have any penality.

Thanks in advance,
Brakkar

lunarboy1

8:40 pm on Mar 8, 2004 (gmt 0)

10+ Year Member



I've been told to use this, GoogleGuy recommended it a while back:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.phoo.com");
exit();
?>

301 error code tells googlebot what you want to say (site doesn't exist anymore), then sends googlebot along to your new one, works almost immediatly for people browsing as well

brakkar

8:49 pm on Mar 8, 2004 (gmt 0)

10+ Year Member



Excellent. This is far better than the code I was using and is really instant.

I redirect www.mysite.com/directory/ to www.mysite.com .

Cordially,
Brakkar

lunarboy1

12:01 am on Mar 9, 2004 (gmt 0)

10+ Year Member



glad to be of service :)