SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL
SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL

IIS 7 URL Rewrite to mix anonymous and secure SharePoint content

This is a quick follow up to Chris’ SharePoint blog post http://blogs.visigo.com/chriscoulson/mixed-anonymous-and-secure-content-with-sharepoint-2010/ with an IIS trick learned from Foreignkid at http://blog.foreignkid.net/2011/11/iis-7-url-rewrite-http-redirect-to-root-site/

Summary

Blending anonymous and authenticated users on a single site can be challenging.  Enable anonymous read on all site content is generally not appropriate.  Anonymous users should only be granted a bare minimum set of permissions.  Enabling read on the “Site Pages” library works well to enable homepage viewing.  However, the challenge with this approach is that anonymous users then cannot “see” the root site (/) in order to be properly redirected with HTTP 302 (/SitePages/Home.aspx) to the homepage.

I recommend leveraging IIS 7 URL Rewrite to handle this direct at the IIS tier before SharePoint sees the HTTP request.   This way all root site (/) requests are correctly sent to the homepage – for both anonymous and authenticated users.

Action Steps

  • Allow Anonymous on the Web Application
  • Create root site collection (/)
  • Enable Welcome homepage
  • Enable Anonymous Access on “Lists and Libraries” under Site Settings
  • Grant “View Items” permission on the Site Pages library
  • Install IIS 7 URL Rewrite .MSI
  • Create a new rule with Regular Expression (^$) and 302 Redirection (SitePages/Home.aspx)

Screenshots

Allow Anonymous on the Web Application

image
image

Create root site collection (/)

image

Enable Welcome homepage

image

Enable Anonymous Access for “Lists and Libraries” under Site Settings

image
image
image

Grant “View Items” permission on the Site Pages library

image
image
image
image

Install IIS 7 URL Rewrite .MSI

Download MSI from http://www.iis.net/download/urlrewrite and install on all web front ends (WFE)

Create a new rule with Regular Expression (^$) and 302 Redirection (SitePages/Home.aspx)

image
image
image
image
image

Hope that helps!

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲