Unanswered How to turn off Mobile redirection for a Doc Lib or for a Site

  • Thursday, April 26, 2012 10:47 AM
     
      Has Code

    Hi,

    How can I turn off mobile redirection for a particular Doc Lib (or for a particular site) without turning it off for the complete web app (by editing the compat.browser file)?

    Why do I need this?

    Well, I have a bunch of content pages (.aspx files, but they are not wiki or web part pages) in a normal Doc Lib (it is not a wiki or any other special library). My content pages refer to lots of external CSS and JavaScript files. Also, they can have JavaScript and Styles defined in the in the head section. One example of such a page is below :

    <%@ Page Language="C#" masterpagefile="~masterurl/custom.master" title="My Page" %> <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server"> <link rel="Stylesheet" href="mycustom1.css" type="text/css" /> <link rel="Stylesheet" href="mycustom2.css" type="text/css" /> <link rel="Stylesheet" href="mycustom3.css" type="text/css" /> <script type="text/javascript" language="JavaScript"> /* Some script code */ </script> <style type="text/css"> /* Some styles defined in the page itself */ </style> <script type="text/javascript" src="myjs1.js" language="JavaScript1.2"></script> <script type="text/javascript" src="myjs2.js" language="JavaScript1.2"></script> <script type="text/javascript" src="myjs3.js" language="JavaScript1.2"></script> </asp:Content> <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> <div style="position:relative;">

    <a href="mypage02.aspx">Another page</a>

    <!-- Some HTML Content --> <script type="text/javascript" language="JavaScript"> /* Some script code */ </script> <!-- Some HTML Content --> </asp:Content>

     If I view this page from a desktop browser, it looks absolutely fine. I want that if someone views this page from a mobile device, he also sees the same view ( as I have made sure that my Master Page and all my pages are also compatible for viewing in the mobile device). Problem is, when a user opens any of my page from a mobile device, it gets redirected to /_layouts/mobile/mbllists.aspx and there it lists all the lists and document library. None of the content from my page is shown. Though the user can append ?Mobile=0 at the end of the url to turn off mobile redirection for the first landing page, the problem is when they click hyperlinks - they get redirected to /_layouts/mobile/mbllists.aspx. I can't convert each hyperlink to have ?Mobile=0 appended in all my content pages, because that is not required for desktop browser, and pages are not only referred from content pages, but also from JavaScript, XML files etc. 

All Replies

  • Thursday, April 26, 2012 11:03 AM
     
     
    You can turn off Mobility redirect support for a specific site by deactivating the hidden MobilityRedirect feature for the site.  MobilityRedirect is a Web scoped feature that is activated in most site templates.  Turning it off will disable mobility redirect.

    Paul Stork SharePoint Server
    MVP Senior Solutions Architect: BlueChip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Thursday, April 26, 2012 11:41 AM
     
     

    Hi Paul,

    Thanks, but it doesn't seem to work. I tried the following command at powershell:

    Disable-SPFeature -Identity MobilityRedirect -Url http://myserver/publish

    It has indeed disabled this feature because If I try the above command again, it throws exception: 

    Disable-SPFeature : Feature 'f41cc668-37e5-4743-b4a8-74d1db3fd8a4' is not activated at this scope.

    But, if I view my pages from a mobile device, they get redirected as earlier. Am I missing something? I assume, we are talking of SharePoint 2010 server.

    Regards,

    -Anil

  • Sunday, April 29, 2012 7:34 AM
     
     
    Hi Anil,

    I did a post around how iPad users aren't redirected. If you have a look at this here:
    http://chrisjhowell.wordpress.com/2012/01/30/ipad-users-are-not-redirected-to-the-mobile-view/

    Scroll to the bottom and I have the link around Joel Oleson's post. It is possible the <browserCaps> area may be of help to you?

    Cheers,

    Chris
  • Sunday, April 29, 2012 11:51 PM
     
     
    Then its not really Mobilty Redirect that is your problem.  Mobility REdirect will automatically put the user in a WAP like screen that only gives access to Lists and libraries.  If you are seeing a graphical screen, but not the one you expect than your only fix is going to be modifying the browser.cap file.  YOu aren't actually being redirected to the Mobile browser version of sharepoint.  But pages are being constrained by what your SharePoint thinks your browser is capable of.

    Paul Stork SharePoint Server
    MVP Senior Solutions Architect: BlueChip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Monday, April 30, 2012 6:57 AM
     
     

    Hi Chris,

    I looked at the Oleson's post. After reading that, what I could make out is that we need to change the web.config file. Though I have not tried is as yet, I believe, changing this file will affect whole of Web App, something, which I don't want. Please let me know If I am incorrect. In that sense, it is similar to changing the compat.browser file which also works at Web App level. I want to turn off the mobile redirection for a particular site only (the site is inside some site collection, which itself is under some Web App). 

    Thanks.

  • Monday, April 30, 2012 7:33 AM
     
     

    Hi Paul,

    As I wrote earlier, It is getting redirected to the  /_layouts/mobile/mbllists.aspx page and what I see there is a listing of Lists and Libraries. I am not seeing any graphical screen. I believe, I have been getting redirected to the mobile version. 

    Thanks,

    -Anil

  • Monday, April 30, 2012 12:53 PM
     
     
    If that's what you are seeing then you are getting redirected to the mobile view, but turning off the mobilty redirect feature should make that view unavailable.  Not sure why you are still getting redirected.

    Paul Stork SharePoint Server
    MVP Senior Solutions Architect: BlueChip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Monday, October 22, 2012 3:52 PM
     
     
    I too have attempted to Disable-SPFeature -Identity MobilityRedirect -Url http://yoursite.  It doesn't seem to work for me either.  Anything else need to be done along with disabling the feature?