Forum Moderators: coopster

Message Too Old, No Replies

PHP Redirects and Search Engines

Wondering if header ("location:") command messes search engines up

         

RdFltErr

12:58 am on Aug 28, 2003 (gmt 0)



Hello,
Recently I've begun using the header ("location:") command to redirect people to new sections on my website. Now the opening webpage is actually a redirect. Suddenly my site is no longer searched by Google! I was wondering if this is a change Google had made or if Google filters out redirected sites. Does anyone know what the deal is with this?

Thanks for your help.

rincey

8:18 am on Aug 28, 2003 (gmt 0)

10+ Year Member



I just can say I use header("location:") redirects on all of my projects and all of them (well, all but one) are spidered and visited regularly by Googlebot.

ad

jatar_k

2:09 pm on Aug 28, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld RdFltErr,

If your page used to be served as is and is now a redirect that may cause some hiccups with indexing.

Suddenly my site is no longer searched by Google

Do you mean that the site is not being spidered or that it is no longer in the index? There are no problems with using header to redirect but redirecting your main page is not really an ideal methodology.

Have ou thought about using include instead? I don't really understand why you would want to redirect straight away when someone hits the main page. Maybe a little more info would help us to give you a more concise answer.

httpwebwitch

7:44 pm on Aug 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you're redirecting, send a "301" status header along with your new location. The 301 status is a message sent to the client (whether it's a browser, spider, crawler, robot, etc) that tells it that your page has moved permanently to a new location. Googlebot should act appropriately.

There is another thread in here all about sending 301 headers to relist pages in Google at a new URI - search for "301 Google" and you ought to find it.

The PHP code looks something like this:

<?php
header("301 Moved Permanently");
header("Location:newURI.com/thispage.htm")
?>