Forum Moderators: coopster

Message Too Old, No Replies

Is there a safe way to redirect with php?

page redirect problem

         

m_leefs

1:40 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



I have been using the following script in the header to redirect to different pages depending on what option they pick from a pull down menu.

switch ($select) {
case "1":
$URL="http://www.anotherpageonmysite.com";
header ("Location: $URL");
break;
case "2":
// do something else //
break;

However I feel that the redirecting in the header is hurting my google ranking. And reading post in the google forum suggests that redirecting is a bad thing. Is there another way to do this?

Netizen

1:44 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



I don't think the redirection is the problem. It looks like you are linking to the pages via a drop down menu which doesn't even have the links in it - how is a search engine spider supposed to find the links off the first page?

m_leefs

2:12 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



The search engine spider can find all the pages by other means, via navigation links at the top of most pages. The menu is just used in a search box, which redirects to other pages that do a specific search based on which option is picked on the menu.
My feeling is that the redirecting is view as spam by google and therefore the ranking may be adversely affected.

Netizen

2:19 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



As I said, I don't think the spider will even get as far as the redirect - there would seem to be nothing for the spider to find as a link for it to be redirected. After all, a spider just reads links on the page, it doesn't go around selecting items from menus, etc.

I don't think this will adversely affect your page rank apart from removing a possible link to the destination pages.

HelenDev

2:24 pm on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What Netizen said sounds right. Why have a drop down menu at all? Why not have the links just on the page - as many sites do - click here for Europe or click here for USA etc.

m_leefs

11:38 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



On one page I have a search box with a text field along with a pull down menu indicating what database they want to search in. This form is then directed to another page that reads what database they want to search (the page with the code from the first message). This page then redirects to a page specific for each database which has its own layout.

I understand that a spider cannot crawl through all the possible options in a form element (which is why I have normal links to the pages specific for each database). I was mainly asking if there was another way to redirect without the header script:

$URL="http://www.anotherpageonmysite.com";
header ("Location: $URL");

because of fear that I might be penalized by Google for "spam" like code.

Elijah

12:10 am on Apr 23, 2004 (gmt 0)

10+ Year Member



because of fear that I might be penalized by Google for "spam" like code.

I wouldn't worry. Neither Google or anyone else can read your php code. ;) The only time this could happen is if your server is misconfigured and it spits out php pages as plain text.