Fetch request from google mobile robot does not set is_mobile() to TRUE |
[eluser]tomyt[/eluser]
I'm using this tool test how Google indexes the mobile version of my site. However, regardless of which mobile version I choose (Mobile: cHTML, XHTML/WML, or Smartphone) it always returns the desktop version of the site. I know settings can be tweaked in the user-agents config file, but I'm looking for guidance as to how. This is important because it's against google's policies to server a different version of the page to google than your regular users. And if they are both using a cellphone, this is something I'm currently doing. Is there a string I can add to the user agent arrays to detect google mobile bot? And more importantly, where should I include it? Since the order of the array also matters. Thanks a ton for your help.
[eluser]tomyt[/eluser]
Incase anyone else ever faces this problem, I'll post the solution I've been meaning to post for a while. in system/libraries/User_agent.php Code: private function _set_robot() This will set the mobile correctly even when a robot is visiting.
[eluser]Aken[/eluser]
I added this as a pull request. Nice addition, thanks. |
Welcome Guest, Not a member yet? Register Sign In |