404 errors, http, https and other fun things with SharePoint SPSiteURL
If you’re using host named site collections in SharePoint 2013 and have set an SPSiteURL in order to map a site collection to a different zone, you may have noticed when you backup that site from one farm to another farm, the default zone moves correctly to the destination farm, but any other zones continue to contain the url from the original source farm. Usually this presents it self as the site working when using the Default zone, but getting a pretty 404, when using the alternate zones. (Users love to use alternate zones). 🙂 (Best 404 eva!) Let say you moved a site collection called https://myweb.contoso.com/sites/teamA and needed to move it to a staging farm, so you restored it at https://myweb.stg.contoso.com/sites/teamA The default zone url is https while the intranet zone is http. Powershell: (run Get-SPSiteURL against the Top Level Site Collection (Root Site) using the Default zone URL) Get-SPSiteURL -Identity https://myweb.contoso.com E.g. Source Farm Top Level Site Collection Url Zone https://myweb.contoso.com Default http://myweb.contoso.com Intranet Destination Farm Top Level Site Collection Url Zone https://myweb.stg.contoso.com Default http://myweb.stg.contoso.com Intranet All the site collections get the Default and Intranet Zones from the Top Level Site Collection. Now if you run Get-SPSiteURL against the actual site collection you just restored E.g. Get-SPSiteURL -identity https://myweb.stg.contoso.com/sites/teamA You’ll see the following. Url Zone https://myweb.stg.contoso.com/sites/teamA Default http://myweb.contoso.com/sites/teamA Intranet Notice the Intranet Zone in invalid. If you’re on the source farm, you can’t hit...
Read More