SharePoint Tidbit - How to redirect sites for the breakup of a web application
Hello All,
I worked on figuring out what I believe is the best way to redirect Site Collections as my customer worked to break up a large Web Application. I found many choices and they all have pros and cons, but I am providing what I liked best.
Using URL Rewrite Module (See support statement https://support.microsoft.com/en-us/help/2818415/supportability-of-rewrites-and-redirects-in-sharepoint-2013--2010--and)
- Pro - No matter which page they try to hit in Site Collection they will be redirected
- Pro - Works with Office and Browser
- Pro - Flexible creation of rules
- Pro - Can lock site or delete to insure that no one adds content in the wrong place and search results are clean
- Con - Needs to be installed and configured on each WFE (Can be mitigated thru use of PowerShell or a single IIS server resource being used)
Steps to implement(Redirecting from https://sp2013app01/sites/horse to https://sp2013app01:27443/sites/horse):
Using URL Rewrite
- Download and install URL Rewrite to all WFE from here /en-us/iis/extensions/url-rewrite-module/using-the-url-rewrite-module#where-to-get-the-url-rewrite-module
- Log onto each SharePoint server and create your rules, using the following:
- In IIS in Web Site double click on URL Rewrite
- Click on Add Rule then Blank Rule, and Ok
- Under 'Match Url' provide a pattern for IIS to catch using Regular expressions and ignoring the host name (See https://technet.microsoft.com/en-us/library/gg440701.aspx) I used the value horse. *
- Create a condition to watch for a particular Web Application (or HTTP_HOST) I used the values {HTTP_HOST} and ^sp2013app01$
- Finally create an action I used the values Redirect and https://sp2013app01:27443/{REQUEST_URI} (See /en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference#Accessing_URL_Parts_from_a_Rewrite_Rule for more info about REQUEST_URI)
- Perform IISReset or Disable then Enable the rule
Hope this helps someone else :)
Pax