I would like to send a visitor to this page:


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?

  • So you want to redirect the user to the first google match on a specific search term?
    – salle
    Oct 16 '09 at 5:49
  • 2
    Or alternatively, maybe you can use "Let me google that for you": lmgtfy.com
    – Arjan
    Oct 16 '09 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
    Oct 16 '09 at 10:14

Put this on the end:


So that your URL is like this:


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.

  • Am deliberately not creating it as a link.
    – random
    Oct 16 '09 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
    Oct 16 '09 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
    Oct 16 '09 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
    Mar 12 '13 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.