Forum Moderators: coopster

Message Too Old, No Replies

PHP header("Location: ");

Redirecting pages for a good reason.

         

jake

4:12 pm on Feb 5, 2004 (gmt 0)



Hi,

I wrote a content management system, and when someone goes to the site, index.php checks the database and instantly redirects the person to the page that has the lowest menu order in the menu table.

Is this just REALLY REALLY bad for search engine placement? I hadn't thought about it until I started reading down through these forums last night.

Thanks for the help!

sdani

4:23 pm on Feb 5, 2004 (gmt 0)

10+ Year Member



I think I would also like to know the answer to this. I have two servers, one for php and one for .NET. Since I can write some code better in php and some better in .NET. My main server is www.widgets.com and my second server is www2.widgets.com - I forward people to www2 server only when I need to show results from some multithreaded processing which I am doing in .NET.
So... I don't want to show same (duplicate) page on www2 server (index page), thus I am using redirect on www2 server. That server's default page redirects the user to my www server.
Is it in anyway a problem? (the www2 server can also be accessed as www.widgets.net) (Since these are hosted at two different hosts, one is .com and one is .net)

lorax

8:07 pm on Feb 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well ... it's not good. You're telling the client (browser and se bots) to use a different URI than the one they originally asked for. You make this obvious by using the PHP function header('Location: ') which will send raw HTTP headers to the client. At best they may get confused and cache the wrong URI. At worst they may think you're doing something more devious and react in a negative way. You can pass server status codes using the header() function but again, I'm not sure how the bots would react.