Professional Support

Get professional support quickly from the people who create and maintain 51Degrees.mobi.

Professional Support
How Much Faster is 51Degrees.mobi Framework?
Watch Speed Comparison Loading the same picture on the same mobile device, with the same network connection, over twice as fast.
Watch Video
Welcome to the 51Degrees.mobi online community. These forums offer the opportunity for you to discuss support topics with your peers and with members of the 51Degrees.mobi development team.
HomeHome51Degrees.mobi ...51Degrees.mobi ...51degrees.mobi ...51degrees.mobi ...Facebook User Agent being detected as Mobi DeviceFacebook User Agent being detected as Mobi Device
Previous
 
Next
New Post
1/23/2012 3:01 PM
 
Hi,

The path to the data file needs to be in another element. Change back what the devicesFile was before (probably ~/App_Data/device.dat") deviceFile isn't for data, it is for keeping a record of previous requests for redirection purposes, particularly in multi server environments.

Your fiftyOne section should look something like this:
<fiftyOne>
   <redirect>
   <!-- None of this needs changing-->
   </redirect>
 
   <log>
   <!-- None of this needs changing-->
   </log>
 
    <detection name="data" binaryFilePath="~/App_Data/51Degrees.mobi-Lite-2012.01.18.dat" enabled="true" />
</fiftyOne>

Thanks,
Tom
 
New Post
1/23/2012 4:08 PM
 
Thanks for the reply Tom.
Same story.

I have specified the path as follows:
<detection binaryFilePath="~/App_Data/51Degrees.mobi-Lite-2012.01.18.dat" />

Just so I understand the process: is 51mobi detection kicked off when I initiate: Browser.IsMobileDevice


2012-01-23T15:26:06.7523879Z - 3496 - Info - Creating provider from binary data file 'D:\Sites\sitename.electricocean.co\App_Data\51Degrees.mobi-Lite-2012.01.18.dat'.
2012-01-23T15:26:07.1267886Z - 3496 - Info - Created provider from binary data file 'D:\Sites\sitename.electricocean.co\App_Data\51Degrees.mobi-Lite-2012.01.18.dat'.
2012-01-23T15:29:30.1767452Z - 4184 - Debug - Getting 'fiftyOne/redirect' configuration from file 'D:\Sites\sitename.electricocean.co\App_Data\51Degrees.mobi.config'.
2012-01-23T15:29:30.1923452Z - 4184 - Debug - Constructing MobileCapabilitiesProvider - Default
2012-01-23T15:29:34.8723534Z - 4184 - Debug - Initialising redirection module
2012-01-23T15:29:34.8879535Z - 4184 - Debug - Initialising redirection module static fields.
2012-01-23T15:29:34.8879535Z - 4184 - Debug - Initialising redirection module event handlers
2012-01-23T15:29:34.8879535Z - 4184 - Debug - Initialising redirection module
2012-01-23T15:29:34.8879535Z - 4184 - Debug - Initialising redirection module event handlers
2012-01-23T15:29:34.9347536Z - 4184 - Debug - Getting 'fiftyOne/detection' configuration from file 'D:\Sites\sitename.electricocean.co\App_Data\51Degrees.mobi.config'.
2012-01-23T15:29:34.9347536Z - 4184 - Info - Creating provider from binary data file 'D:\Sites\sitename.electricocean.co\App_Data\51Degrees.mobi-Lite-2012.01.18.dat'.
2012-01-23T15:29:35.3715543Z - 4184 - Info - Created provider from binary data file 'D:\Sites\sitename.electricocean.co\App_Data\51Degrees.mobi-Lite-2012.01.18.dat'.
2012-01-23T15:29:35.9955554Z - 4184 - Debug - Request for 'http://sitename.electricocean.co/' with handler type 'System.Web.Mvc.MvcHandler' and current page '' is not a restricted page for redirect.
2012-01-23T15:29:35.9955554Z - 4184 - Debug - Redirecting device with useragent 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)' from url 'http://sitename.electricocean.co/' to '~/mobi' due to 'default'.
2012-01-23T15:29:36.4791563Z - 4184 - Debug - Request for 'http://sitename.electricocean.co/mobi' with handler type 'System.Web.Mvc.MvcHandler' and current page '' is not a restricted page for redirect.
2012-01-23T15:29:36.4791563Z - 4184 - Debug - Redirecting device with useragent 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)' from url 'http://sitename.electricocean.co/mobi' to '~/mobi' due to 'default'.
2012-01-23T15:29:41.5179651Z - 4184 - Debug - Request for 'http://sitename.electricocean.co/' with handler type 'System.Web.Mvc.MvcHandler' and current page '' is not a restricted page for redirect.
2012-01-23T15:29:41.5179651Z - 4184 - Debug - Redirecting device with useragent 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)' from url 'http://sitename.electricocean.co/' to '~/mobi' due to 'default'.
2012-01-23T15:29:41.9859659Z - 4184 - Debug - Request for 'http://sitename.electricocean.co/mobi' with handler type 'System.Web.Mvc.MvcHandler' and current page '' is not a restricted page for redirect.
2012-01-23T15:29:41.9859659Z - 4184 - Debug - Redirecting device with useragent 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)' from url 'http://sitename.electricocean.co/mobi' to '~/mobi' due to 'default'.
 
New Post
1/23/2012 4:19 PM
 
I guess these are the lines where are the action is:

Debug - Request for 'http://sitename.electricocean.co/' with handler type 'System.Web.Mvc.MvcHandler' and current page '' is not a restricted page for redirect.
2012-01-23T15:29:35.9955554Z - 4184 - Debug - Redirecting device with useragent 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)' from url 'http://sitename.electricocean.co/' to '~/mobi' due to 'default'.
 
New Post
1/24/2012 5:09 AM
 
Just a quick note to report status update. Seems the Facebook like user agent is not part of the 51Degrees.mobi-Lite-2012.01.18.dat file so Facebook is redirected to your mobi site when it scrapes your page. 

I have a custom view engine and the mobileHomePageUrl attribute in the redirect config element was causing problems for me and had to remove it to get the view engine working.

I have resorted to a manual hack by checking as follows:
private static bool _IsMobileDevice ()
        {
            var isMobileDevice = HttpContext.Current.Request.Browser.IsMobileDevice;
            //HACK: issue with Facebook scraper viewing the site as MOBI site.
            if (HttpContext.Current.Request.UserAgent != null)
            {
                if (HttpContext.Current.Request.UserAgent.Contains("facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_u...)"))
                {
                    Log("FB UserAgent");
                    isMobileDevice = false;
                }
            }
            return isMobileDevice;
        }


 
New Post
1/24/2012 9:52 AM
 
Hi,

Sorry for the confusion. We have just identified a discrepancy between how the Lite and Premium data is created so it appears the Facebook crawlers did not make it into the Lite data when they should've done.

We'll be correcting this in an update very soon.
Thanks,
Tom
 
Previous
 
Next
HomeHome51Degrees.mobi ...51Degrees.mobi ...51degrees.mobi ...51degrees.mobi ...Facebook User Agent being detected as Mobi DeviceFacebook User Agent being detected as Mobi Device