Changing the HTTP redirect URL in one website in IIS changes the redirect URL on other websites. How can I redirect multiple host names in IIS to different URLs?
I am currently working on a SharePoint 2013 deployment to house a couple of intranets within one farm and one web app. This is an on prem deployment, but were striving to keep everything in line with O365 constraints so that we can move there some day if we choose. One of the constraints is that we are trying to adhere to is that we want to use the standard URLs that SharePoint creates… specifically, were just going to stick with “http://farm/sites/sitename”
The problem that we have with this is that the URLs are not friendly and – more importantly – they aren’t what the user is used to. We have many business solutions built out within our SharePoint 2013 environment each with a specific use, and most often they need a short and easy to remember URL.
- Deal Tracking Solution = http://dealtracking
- Reports Portal for Company 1 = http://company1reports
- Reports Portal for Company 2 = http://company2reports
- Company1 Intranet = http://company1intranet
- Company2 Intranet = http://company2intranet
But these are all in my single SharePoint environment, right? Their URLs all look like http://farm/sites/… How do I get around it?
- DNS – we first create a DNS entry to point back to my SharePoint WFE IP address using a friendly name (e.g. DEALTracking)
- Create a new website in IIS – give it your friendly name just for our own sanity
- Assign it to your favorite app pool (I used the Default)
- Set your physical path to the www root since this is a dummy site only used for redirect
- Set your host name to match up with the DNS entry
- Set up the HTTP Redirect to use the URL of the SharePoint site to which you need to redirect
Easy, right?! This will work when you need to do one redirect on a site. If you try to create more dummy sites for redirection in the same way you’ll run into problems. Specifically, when you change http redirect on the site it will also change the redirect URL on the original site from the steps above.
Solution: physical path
All websites using the same physical path share HTTP Redirect
The simple work around for this is to create an empty folder in the www root for each site that needs redirection. This solved my problem.