How to create a Redirect (URL Shortcut) to a Subsite in SharePoint?

Requirement:
We have a sub-site located at the URL – https://sharepoint.crescent.com/sites/marketing/regions/us/brandcenter/, and the requirement is to create a shortcut to this subsite. That is the URL shortcut: https://brandcenter.com should redirect to the above subsite.

Solution: To redirect to a subsite in SharePoint, let us use the IIS HTTP Redirect module. Follow these steps to redirect to a subsite.

Make sure HTTP Redirection module is installed before proceeding. If not, enable it from Server Manager!

Step 1: Create necessary DNS entries for your new host name

To begin with, create DNS entries for your new host (in my case: https://brandcenter.com). Based on your requirement, it could be a HOST-A Record / Forward Lookup Zone / CNAME, etc. For testing purposes, you can make an entry in your HOST file (located at: C:\Windows\System32\drivers\etc)

Step 2: Create New IIS Web Site:

  • Go to IIS of your SharePoint Web front end server(s), Right-click “Sites” node create a new site by choosing “Add Web Site”redirect sharepoint site to a subsite
  • Set the site name, Application Pool, Physical path accordingly. Host header as your new host name. Click on the “Test Settings” button to make sure your application pool account is able to access the virtual directory and authentication works as expected.
    sharepoint 2010 redirect from root to subsite

Step 3: Configure HTTP Redirect Module in IIS

Now, Open the “HTTP Redirect” module from the IIS Site you have created.
sharepoint 2010 redirect from root to subsite
Enable the “Redirect requests to this destination” check box and enter the full URL of your subsite. Enable the “Redirect all requests to exact destination” check box also.

How to redirect to a subsite in sharepoint

It is also possible to use Tokens in the URL, such as: $S = Path, $Q = Query String.

That’s all! Now, when a user hit https://brandcenter.com, they’ll be redirected to: https://sharepoint.crescent.com/sites/marketing/regions/us/brandcenter/ Its also possible to manage all these things using the command line: AppCmd .Refer: https://docs.microsoft.com/en-us/iis/get-started/getting-started-with-iis/getting-started-with-appcmdexe

PowerShell script to set IIS HTTP Redirect:

import-module webAdministration

#Set these variables: Site name and Redirect URL 
$SiteName = "BrandCenter"
$RedirectURL = "https://sharepoint.crescent.com/sites/marketing/regions/us/brandcenter/"
 
# Set the redirect
Set-WebConfiguration system.webServer/httpRedirect "IIS:\sites\$siteName" -Value @{enabled="true";destination="$RedirectURL";exactDestination="true";httpResponseStatus="Found"}

This trick works on SharePoint 2007, SharePoint 2010 and SharePoint 2013 to redirect to subsite URL.

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 *