SPSite.SetUrl method

SharePoint 2013

Set secondary URL and zone for the site collection. If the URL exist for the site collection, then we only update the zone for the existing URL. If the URL does not exist, we will add the URL and the zone for the site collection.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public void SetUrl(
	Uri uri,
	SPUrlZone zone


Type: System.Uri

The URL to set for the site collection.

Type: Microsoft.SharePoint.Administration.SPUrlZone

The zone for the URL to set