Hey guys,

Just curious about something here.

I know that you use JavaScript to redirect users to your mobile site based on OS, Resolution, etc. So if they go to the normal URL from a normal device, then they are redirected to a mobile site.

But how about Google?

If, for example, I search "YouTube" in Google from a mobile phone, the first result is "m.youtube.com" with a mobile icon beside it, not "youtube.com" as I would expect.

How does this work?

Is it only available to certain people who contact[and pay?] Google to put their mobile site there if searched from a Mobile.

Or is it based on your sitemap?

Or does Google somehow automatically search your site for a mobile site?

Perhaps for a specifically named stylesheet?


Thanks in advance!


[P.s. I just realized Youtube is a bad example seeing as Google own it, but it happens with lots of other non-Google sites too.]