6

I would like to send a visitor to this page:

http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=6920927181221

But if there is no referrer to http://www.google.com, the functionality I'm feeling lucky doesn't work.

Do you have any idea how to do so?

3
  • So you want to redirect the user to the first google match on a specific search term?
    – salle
    Commented Oct 16, 2009 at 5:49
  • 2
    Or alternatively, maybe you can use "Let me google that for you": lmgtfy.com
    – Arjan
    Commented Oct 16, 2009 at 9:56
  • As for the original title, "How to open an URL in a browser with a refer(r)er page?": you really can't do that without hacking the browser (or without proxying the result through your own server). So, I've changed the question for future reference. (Especially as that button seems to be disappearing from the new Google homepages.)
    – Arjan
    Commented Oct 16, 2009 at 10:14

1 Answer 1

5

Put this on the end:

&sourceid=navclient

So that your URL is like this:

http://google.com/search?btnI=I%27m+Feeling+Lucky&q=6920927181221&sourceid=navclient

For example: Stack Overflow, which when clicked will have the HTTP REFERER header set to http://superuser.com/questions/56021/[...]. The same link sent through email, or when opened using right-click » Open Link in New Window, will have no REFERER set at all (in most browsers). All seem to work fine.

4
  • 1
    Am deliberately not creating it as a link.
    – random
    Commented Oct 16, 2009 at 6:21
  • Note that Google is changing the URLs. This might keep working forever, or a long time, or maybe will fail sooner than we think. See stackoverflow.com/questions/1122523/…
    – Arjan
    Commented Oct 16, 2009 at 9:58
  • 1
    I initially thought the question was about sending a link through email or whatever (having no REFERER at all), and actually I'm a bit surprised that this also still works when using ANOTHER referrer, like when linked from another site. But: you're right, it does work. I've added a safe link to Super User as an example.
    – Arjan
    Commented Oct 16, 2009 at 10:27
  • 2
    This seems to be sensitive to the query. The example query works, but for some other search queries, it still gives the results page instead of redirecting to the first result. It's not clear to me what separates the two scenarios.
    – Cheetah
    Commented Mar 12, 2013 at 14:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .