SPAlternateUrlCollectionManager class

Provides methods that can be used to perform operations on all the SPAlternateUrlCollection objects in the farm.

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

<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPAlternateUrlCollectionManager _
	Inherits SPPersistedChildCollection(Of SPAlternateUrlCollection) _
	Implements IEnumerable(Of SPAlternateUrlCollection), IEnumerable(Of SPAlternateUrl),  _
Dim instance As SPAlternateUrlCollectionManager

Use the SPFarm.AlternateUrlCollections property to return the SPAlternateUrlCollectionManager object for the server farm.

The following example verifies that the RebaseUriWithAlternateUri method converts a specified incoming URL to the default zone outgoing URL.

Dim altUrlCollection As SPAlternateUrlCollection = SPContext.Current.Site.WebApplication.AlternateUrls

Dim altUrlCollectionMgr As SPAlternateUrlCollectionManager = SPFarm.Local.AlternateUrlCollections

Dim incomingUri As New Uri("http://MyIncomingUrl")

Dim responseUri As Uri = altUrlCollectionMgr.RebaseUriWithAlternateUri(incomingUri, SPUrlZone.Default)

If responseUri = altUrlCollection.GetResponseUrl(SPUrlZone.Default).Uri Then
    Response.Write("Incoming URI converted to default outgoing URL.")
End If

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.