Wurfl.js Redirecting Googlebot

I have this HTTP request, I expected this, but WURFL is returning that. Please provide enough data to reproduce the problem.
whynot
Posts: 3
Joined: Wed May 18, 2016 12:17 am

Wurfl.js Redirecting Googlebot

Postby whynot » Wed May 18, 2016 12:21 am

We are currently using wurfl.js on two of our sites to redirect our mobile visitors to our mobile subdomain however both sites have now been deindexed by Google. We attempted to spoof the user agent using a browser plugin and noticed that wurfl is redirecting Googlebot crawler to our mobile domain. We don't want this behavior as the majority of our content is on the desktop site.

How can we fix this?

aaronp
Posts: 242
Joined: Wed Dec 09, 2015 12:39 pm

Re: Wurfl.js Redirecting Googlebot

Postby aaronp » Wed May 18, 2016 9:33 am

Hi James,

Thank you for letting us know. Are you able to provide a sample of the User Agent string that is being spoofed?

Aaron

whynot
Posts: 3
Joined: Wed May 18, 2016 12:17 am

Re: Wurfl.js Redirecting Googlebot

Postby whynot » Wed May 18, 2016 2:40 pm


aaronp
Posts: 242
Joined: Wed Dec 09, 2015 12:39 pm

Re: Wurfl.js Redirecting Googlebot

Postby aaronp » Thu May 19, 2016 9:42 am

Hi James,

After testing the provided User Agent string, It returns `false` for `is_mobile` and `true` for `is_robot`.

Are you able to let me know what capabilities/logic you are using to redirect to desktop/mobile sites?

Thanks,

Aaron

whynot
Posts: 3
Joined: Wed May 18, 2016 12:17 am

Re: Wurfl.js Redirecting Googlebot

Postby whynot » Thu May 19, 2016 6:37 pm

Thanks for getting back to me Aaron. We've solved the Googlebot issue by using the code below however now all bots including the mobile bots of major search engines are being directed to the desktop version of our site. We want to be able to send the mobile crawlers from search engines to the mobile version of our site. Without this feature, the crawlers will not be able to see the mobile version of our sites and will penalize the site for not being mobile friendly.

<script type='text/javascript' src="//wurfl.io/wurfl.js"></script>
<script type="text/javascript">
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca;
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length,c.length);
}
return 0;
}
var cookie = getCookie('redirecToDesktop');
if (cookie == 0) {
if (WURFL.form_factor != 'Desktop' && WURFL.form_factor != 'Tablet'
&& WURFL.form_factor != 'Robot') {
var href = window.location.href;
//href = href.replace('m.domain.com');
href = href.replace('//', '//m.');
window.location.href = href;
}
}
</script>

See the following link for a list of all of Google's UAs

https://support.google.com/webmasters/a ... 1943?hl=en


Who is online

Users browsing this forum: No registered users and 22 guests