php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24303 Google search contains a lot of redirects back to Google
Submitted: 2003-06-23 17:34 UTC Modified: 2003-08-21 19:29 UTC
From: vlanard at cal dot berkeley dot edu Assigned: goba (profile)
Status: Closed Package: Website problem
PHP Version: 4.3.1 OS: Windows 2000
Private report: No CVE-ID: None
 [2003-06-23 17:34 UTC] vlanard at cal dot berkeley dot edu
Description:
------------
The search parameters being sent to the Google website from your inline search (across whole site/online documentation, etc.) are passed in the wrong order. As a result, any Google search results found do not link users into the PHP.net website when clicked, but rather resubmit another search to Google. It's like an infinite loop of Google searches. Simply reordering the Google parameters solves the problem.

The parameters currently being passed to Google with a sample query of "control" are:
control site:www.php.net

The correctly ordered parameters should be:
site:www.php.net control

"site:" apparently needs to be the first argument.

Reproduce code:
---------------
1. Go to http://www.php.net/manual-lookup.php
2. Enter search for term "control" in "online documentation [en]" and click the arrow to submit the search.
3. Note that you get a Google page of results.  
4. Click on any of the Google results and note that it just submits another Google search rather than linking you back to the PHP.net website.  
5. Change order of Google search parameters so that site:www.php.net is the first argument, and resubmit. Note that it now works correctly.

Expected result:
----------------
Google links should bring user into the PHP.net site.

Actual result:
--------------
Google links just submit another Google search.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-23 17:45 UTC] alindeman@php.net
Umm, the arguments are in fact in the correct order and the search works as expected.  I went through the exact steps you posted and everything works as expected.  Re-open if you can provide steps that actually represent a problem...
 [2003-06-23 18:14 UTC] vlanard at cal dot berkeley dot edu
Ok, you're right that some of the Google links do work. I clicked on several and none of them worked. A lot of them do simply resubmit a new Google search though, perhaps because of the way you're doing the Google redirects? 

In the "control" example I cited in this bug, of the first 5 Google results that come back, 3 of them (links #2,3,5) submit another Google search, rather than linking into your site.  I reported this bug initially after every link I happened to click on was one of the Google loopbacks.

Definitely not the severity of the initial bug I reported. Sorry. But still rather funky...  I've changed the bug title accordingly. Perhaps this is just a known limitation of the redirect system, so if you want to leave it as is, at least you now know it's happening. I won't pile up any more comments for you. :-)
 [2003-06-23 22:02 UTC] philip@php.net
This bug is valid.  Let's be specific and use control as an example:

http://www.google.com/search?q=control+site:www.php.net&l=en

This yields the following results from Google:

1) http://www.php.net/ref.outcontrol *
2) http://www.php.net/control-structures
3) http://www.php.net/de/blog
4) http://www.php.net/elseif *
5) http://www.php.net/en/manual
6) http://www.php.net/session_cache_limiter *

The URL's with * work.  The only one I see that really should work is #2 as apparently this shortcut used to work and it should work and present the following:

http://www.php.net/manual/en/control-structures.php

Assigning to Goba.  Regarding #5, it should be manual/en, not sure what Google is thinking there :)


 [2003-06-23 22:04 UTC] philip@php.net
Btw, the following does work (using a mirror, not www):

http://uk.php.net/control-structures
 [2003-06-24 02:13 UTC] goba@php.net
Commenting on the original bug submitters error report, I get the same results, even if I reorder the site:www.php.net and the search keyword. I don't know how you can get it differently. If you open a plain google.com, go to advanced search, and type in control to the search for field, and type in www.php.net to the site field, then you get to a search result page with "control site:www.php.net" in the search field [the same you get with PHP.net search]

Regarding URL shortucts, my question is what to header Google parses to know that a page does not exist. We need to clean out the bogus URLs from Google. That is we need to add code to php.net so if googlebot revisits our site sometime, it finds that those URLs are "not found".

I guess if we return a 404 and a Location header then many browsers will display a 404 page [eg. IE], instead of redirecting. If it is at all possible to use 404 with a location header in HTTP...

I'll look into why those URL shortcuts are not working.
 [2003-08-21 03:23 UTC] goba@php.net
The search results for control seem to be all working for me now (only checked the first page ;) Any problem with them?
 [2003-08-21 10:54 UTC] vlanard at cal dot berkeley dot edu
yah, it does appear to be resolved now.
thanks.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 22:00:01 2026 UTC