51 degrees how do not detect IPad as mobile device

779 Views Asked by At

I have my .net mvc4 application with area named "Mobile", in my web.config file 51 degrees configured to redirect mobile devices to this area :

  <redirect firstRequestOnly="false" mobileHomePageUrl="~/Mobile" timeout="20" devicesFile="~/App_Data/Devices.dat" mobilePagesRegex="Mobile"></redirect>

How can i configure 51 degrees to do not redirect iPad. Or in another words : ignore IPad as mobile device?

i was try to add "locations":

<locations>
  <location name="Mobile" url="~/Mobile">
   <add property="IsTablet" matchExpression="false"/>
   <add property="IsMobile" matchExpression="true"/>
  </location>
</locations>

and this is not help...

1

There are 1 best solutions below

0
On

I found the solution for my own question. In web.config file :

<redirect firstRequestOnly="false" mobileHomePageUrl="~/Mobile" timeout="20" devicesFile="~/App_Data/Devices.dat" mobilePagesRegex="Mobile">
<locations>
<location name="noredirect" url="">
          <add property="Url" matchExpression="[&amp;|\?]noredirect"/>
        </location>
      </locations>
</redirect>

in mobile Area default controller:

if (Request.Headers["User-Agent"].ToLower().Contains("ipad"))
            {
                return Redirect("someurl?noredirect=true");
            }