1

How to disable mobile browsing for a single website in SharePoint 2010 without disabling all of websites in SharePoint?

As far as I know we can disable it as described here or here. But when applying those instructions, mobile browsing disabled for all of the websites in SharePoint. What I want is to disable it only for a single website like "mydomain.com/sites/mysite"

3 Answers 3

0

I guess you can achieve this with PowerShell script,

#Disable Mobile Redirection for all browsers for a given web application

param( [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)] 
            [Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]
            $WebApplication)

# SharePoint cmdlets
Add-PSSnapin Microsoft.SharePoint.PowerShell
if([Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")-eq$null){throw "Unable to load Microsoft.SharePoint.dll";}

$WebApp = $WebApplication.Read()

$configMod1 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification
$configMod1.Path = "configuration/system.web"
$configMod1.Name = "browserCaps"
$configMod1.Value = '<browserCaps><result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /><filter>isMobileDevice=false</filter></browserCaps>'
$configMod1.Sequence = 0
$configMod1.Owner = "contoso\administrator"
## SPWebConfigModificationType.EnsureChildNode -> 0
$configMod1.Type = 0

$WebApp.WebConfigModifications.Add( $configMod1 )

$WebApp.Update()

$WebApp.Parent.ApplyWebConfigModifications() 

Remove-PsSnapin Microsoft.SharePoint.PowerShell

got this script from this article:

http://gavinb.net/2011/06/13/disable-mobile-redirection-for-a-web-application-via-powershell/

Hope this helps!

1
  • 1
    If this script works,it is for disabling mobile browsing for all websites in a web application in SharePoint.But i want disable mobile browsing for a single website in a web application not all of the website.
    – Khosro
    Commented Oct 2, 2013 at 12:40
0

You can use media query to identify the mobile device, then use the javascript to redirect the site to specific page saying access denied.

It should be done in a master page.

0

One possible solution is to add a http redirect only for the sub site in web.config using location settings, if you have access to web.config

Ex:

<location path="subsite/_layouts/mobile">
    <system.webServer>
      <httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Found">
        <add wildcard="*" destination="/subsite" />
      </httpRedirect>
    </system.webServer>
</location>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.