20

I'm not sure how long they've been doing it but I just noticed google using # in their search url instead of search?.

New way
http://www.google.com/#q=stackoverflow
Old way
http://www.google.com/search?q=stackoverflow

The pound/hash sign is generally used as an anchor to a section of a page.
Besides a shorter url what could be the benefits to Google? It seems to go against search engine convention, but then again Google sets convention. Are there any problems you can see to this approach?

UPDATE
To test for yourself use the general search box on www.google.com. You'll get some other junk in the url but the portion before the q= is what I'm referencing for this question.

UPDATE 2
Looks like this may be an experimental feature they're testing with random users as some people are being rerouted to the search? results when trying to go to the # results.

UPDATE 3
From the conversation here it appears this has been rolled out to all firefox users using the main google.com site for searching.

excerpts

4/27/09 The # in query parameters is a separate experiment that the search team was doing (AJAX based search results pages) that started some time back. It was discussed quite fervently in the Yahoo Web Analytics discussion group a few months ago. Random groups of people were/are assigned to be a part of the experiment, and that caused all the keyword data for that user to dissapear from every Analytics tool. It looks like the experiment is still going on.

4/28/09 The # in query parameters appears to have been rolled out to all Firefox users on www.google.com SERP`s, so this must have passed the testing stage. I am speculating that FireFox is able to handle AJAX better that IE, thus it has not been rolled out to IE users.

5/1/09 When I dug into the SERP's pages it looks like Google initially puts the websites "true" URL in the link, but once the link is clicked the URL is replaced with a Google redirect URL of the form www.google.com/url?q=flowers&blahblahblah. That redirect URL is what shows up in the HTTP referrer field and what gets reported by the web browser (and therefore the Analytics tools).

6
  • Your first link doesn't work for me, instead Google insists on redirecting to my national Google site. Commented Jul 13, 2009 at 22:54
  • 1
    When do you see the url with the pound sign? I just ran a search for puppies and recieved the following url. google.com/… Commented Jul 13, 2009 at 22:54
  • Aha, that might be why Google is changing the referrer. See stackoverflow.com/questions/1537469/…
    – Arjan
    Commented Oct 9, 2009 at 20:02
  • And fun fact: most browsers (or all of them) do NOT send the value of the hash to the server. So, Google needs JavaScript to actually interpret the hash and show the results...
    – Arjan
    Commented Oct 9, 2009 at 21:12
  • And as for the redirect: searching for "phpinfo() zend license variables -manual" yields quite a few results that redirect to a page that shows HTTP_REFERER when clicking the search result -- google.com/#q=phpinfo()+zend+license+variables+-manual
    – Arjan
    Commented Oct 9, 2009 at 22:30

6 Answers 6

17

My google still uses the search? prefix, however the benefit of using the hash (#) is that it does not require reloading the page. Adding a query string (?) forces the page to reload in all browsers.

By using the hash they can keep an item in 'memory' by allowing it to persist in the browser element. Adding the hash also creates a history object for the page. This maintains forward and back functionality, while allowing them to process your search using AJAX. Basically this means they can process your search quicker by only having to fetch a subset of the HTTP headers required to load an entire page without losing functionality of a full load.

2
  • 1
    Ian, you're exactly right. When I search from Google.com (with firefox) and search a couple more times on the same results page, then use the browsers backward and forward buttons there is no page reload. If I force the search to use search? and do the same experiment the page reloads each time.
    – GollyJer
    Commented Jul 14, 2009 at 6:45
  • It's perfectly fine to cache results of GET requests (as opposed to results of a POST), though many people wouldn't actually want their search results to be cached at all. Even more: Google currently explicitly disables caching in its ?q= responses: web-sniffer.net/… They don't need the hash to change that behaviour. However, you may be right about loading the search results through Ajax, while still wanting the (changed) search terms to be in the URL. That's certainly easier with the hash; some testing at jsbin.com/esuma
    – Arjan
    Commented Oct 9, 2009 at 21:05
7

A quick Google search (using the good ol' ?q= method...) turns up this:

Has Google.com changed to google.com/#q=flowers for FireFox users? (I was expecting google.com/url?q=flowers)

a couple months ago Google tested some search results that added a # into the URL. This created a big problem for people interested in seeing which keywords were driving traffic to their site (anything in the URL after a # doesn't get passed in the referrer... this is particularly a problem for web analytics products), so we worked with the search team to stop that test until they could find a better solution.

So, at one time this URL format was used for some subset of users, as part of one of the many tests that Google runs on unsuspecting subsets of its users. It caused problems for analytics software, so they switched to a different format for future tests, but still support the old hash-query URLs (by silently redirecting them to normal ?-query URLs).

1
  • It's definitely not old or deprecated. The link you posted talks about how they solved the analytics software problem. I posted update three to the question with some details.
    – GollyJer
    Commented Jul 14, 2009 at 6:58
4

well, facebook uses this technique for loading images without unloading the page, but still letting the person be at a distinct URL.

if you change the search query then, you can update the url in the address bar without reloading the page (no new GET request should be fired by the browser when you modify stuff after #)

1
  • 1
    Actually, I believe Facebook uses this method for their entire website. Commented Jul 13, 2009 at 23:20
1

Seems #q=stackoverflow redirects to search?q=stackoverflow&cad=h.

I don't know how you're getting that however - I get the usual one.

1

Actually first above redirects to the second.

1

This move by Google seems to have generated unwanted results. Google now shows a redirect page for EVERY search which includes a # character. Try it - it's so annoying. As a developer I search for C# a lot - and this issue has made me consider Bing as a better experience.

2
  • # gets converted to %23 automatically when I search with it.
    – GollyJer
    Commented Jul 8, 2010 at 20:01
  • Yes, google converts it. But if you type it directly into the url bar, there a couple bugs.
    – Bluedayz
    Commented Sep 10, 2014 at 15:13

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