Alternate Access Mappings helps to expose a SharePoint web application into different URLs in scenarios such as publishing, load balancing, reverse proxy, etc. Each web application can have up to five different URLs through alternate access mapping, with “Default” zone as mandatory and other optional zones.
How to Configure Alternate Access Mapping in SharePoint Central Administration?
Follow these steps to set alternate access mapping in SharePoint.
- Go to the SharePoint 2016 Central Administration Site, Click on System Settings from Left navigation menu.
- From the “System setting” page, click on “Configure Alternate Access Mappings” link under in the “Farm Management” group.
- You will be presented with the Alternate Access Mappings page. Select your desired web application to get the AAM settings for the specific web application.
Here, The public URL is the address of the Web Application, where the traffic will be routed to. Internal URLs are what’s entered in the browser, and it’s either transformed/mapped into the Public URL.
To add an alternate access mapping, with the target web application selected, Click on “Edit Public URL’s” link >> Enter the appropriate URL for respective zone and hit Save to commit your changes.
You can also use PowerShell to manage Alternate Access Mappings in SharePoint.
Add alternate access mapping SharePoint using PowerShell:
To add an entry to SharePoint alternate access mapping using PowerShell, use cmdlet: New-SPAlternateURL. Here is an example:
New-SPAlternateURL –WebApplication "http://intranet.crescent.com" -URL "http://portal.crescent.com" –Zone Internet
Add a binding to the web application in IIS:
But wait, You are not yet done. This is a common miss in SharePoint. Although you add AAM entry, You must also add IIS binding for the web application for initial redirect to the IIS site.
You can now access the existing SharePoint web application “http://intranet.crescent.com” using the new URL “http://portal.crescent.com”.
PowerShell to remove alternate access mapping:
To remove an existing AAM entry, use the PowerShell cmdlet: Remove-SPAlternateURL, Here is an example:
Get-SPAlternateURL –WebApplication "http://intranet.crescent.com" –Zone "Internet" | Remove-SPAlternateURL
Get SharePoint alternate access mappings using PowerShell:
To read all alternate access mappings for a given web application, use this PowerShell script.
Get-SPAlternateURL -WebApplication "http://intranet.crescent.com" | Format-table -AutoSize
Similarly, to get the AAM settings for a specific zone, say: Internet, use:
Get-SPAlternateURL –WebApplication "http://intranet.crescent.com" –Zone "Internet"