Share via


SharePoint 2013: App Web Renders a Blank Page When You Try to Browse/Launch an App from a SharePoint Site Over HTTP or HTTPS.



Symptoms

When you try to browse/launch an App on a SharePoint site, which can be over HTTP or HTTPS - it does not render the Appweb instead gives out a blank page.

The ULS logs show the following:

System.UriFormatException: Invalid URI: The hostname could not be parsed. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)     at Microsoft.SharePoint.SPSite.GetHostHeaderRelativeUrlFromLookupKey(String hostHeaderLookupKey)     at Microsoft.SharePoint.SPSite.LookupSiteInfo(SPFarm farm, Boolean contextSite, Boolean swapSchemeForPathBasedSites, Uri& requestUri, Boolean& lookupRequiredContext, Guid& applicationId, Guid& contentDatabaseId, Guid& siteId, Guid& siteSubscriptionId, SPUrlZone& zone, String& serverRelativeUrl, Boolean& hostHeaderIsSiteName, Boolean& appWebRequest, String& appHostHeaderRedirectDomain

Request for app scheme does not match the webapp's scheme for this zone. Request Uri: https://app-.ContosoApps.com/Pages/Default.aspx?SPHostUrl=https://Intranet.contoso.com&SPLanguage=en-US&SPClientTag=0&SPProductNumber=15.0.4420.1017&SPAppWebUrl=https://app-.ContosoApps.com/  Zone Response Uri: http://intranet Site collection path: /.

Cause

The App request URL and the App service response URL for the requested App must be on the same protocol (either HTTP or HTTPS)

In my case the App request URL wa over HTTPS but the App service response URL was over **HTTP (i.e.) The site/app was browsed using the URL https://contoso.com but the App service response for the requested app was http://contoso.com **because that is the URL (Protocol) set in the **DEFAULT ZONE **of that web application.

The App service respond using the Default zone protocol. This is a security measure to avoid CROSS-DOMAIN attacks when the app is requested or launched.

Resolution

​1. If the Site/App is browsed over HTTP and you experience the above behaviour (a blank Page), set the Default zone URL of that web application to HTTP and try again.

2. If the Site/App is browsed over HTTPS and you experience the above behaviour (a blank Page), set the Default zone URL of that web application to HTTPS and try again.