How to Redirect in SharePoint using Alternate Access Mapping (AAM)?

Internal URL in SharePoint Alternate Access Mapping is used to redirect from one URL to another. E.g., If you want to redirect or transform from “https://portal.crescent.com” into “https://intranet.crescent.com” use this feature! So, you enter “https://portal.crescent.com” in the address bar of your browser, and it takes you to “https://intranet.crescent.com”!

How to Add URL Redirection using Alternate Access Mapping?

Here is how to achieve web application redirect using AAM:

  • Go to SharePoint 2016 Central Administration >> Click on “System Settings” >> Configure alternate access mappings
  • Select your web application from the drop-down list. Click on the “Add Internal URLs” link on the toolbar
    sharepoint redirect site to another site
  • Enter the desired URL and select the zone from the list, and hit save to commit your changes. In my case, I wanted to redirect from “https://portal.crescent.com” to “https://intranet.crescent.com”
    sharepoint iis redirect http to https

PowerShell to Add Internal AAM Entry:

To add an internal alternate access mapping entry, use this PowerShell script.

New-SPAlternateURL -WebApplication "https://intranet.crescent.com" -URL "https://portal.crescent.com" -Zone Default -Internal

Update IIS Binding with the Redirect URL:

Once the SharePoint side entry is added, the next step is to add the binding in IIS. Go to IIS, locate your web application >> Edit Bindings >> Add the URL to the binding.

Sharepoint redirect url

Now, open a new browser instance (or open a browser in private mode to avoid caching). Check the URL redirection in place! This redirects not just works for top-level URLs, but it also works for all internal links.

This method of redirect can be used in SharePoint to redirect from HTTP to HTTPS.

How to remove the Redirect?
From the “Alternate Access Mappings” page, Just click on the redirect URL you had created, and in the Edit Internal URLs page, hit the “Delete” button to remove the redirection placed for the web application.

sharepoint redirect relative url
Beware of the browser caching: You may not get the changes immediately even you made some modification as above. Try opening a new private browser and check!

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *