March 26, 2014

Changing the FQDN of a SharePoint site

From time to time we get asked what the best way to change the Fully Qualified Domain Name of a SharePoint site.  Typically this is because an internal only name was used, and now there is a desire to expose the site externally over SSL.  Examples would be http://server1, or http://portal.contoso.local being changed to https://portal.contoso.com.

While people often feel they can just change the IIS bindings for their site and update SharePoint's Alternate Access Mappings, and they're done.  The correct process, as described in http://technet.microsoft.com/en-us/library/cc262366(v=office.15).aspx, is a little different.  The basic steps are:

  1. Unextend by removing SharePoint from the IIS Web site
  2. Rextend onto a new IIS Web site with the new URL and port information
  3. Setup any required redirects from the old URL

You do need to be careful though, as you don't want to actually delete the web application.  Here's the steps in more detail:

Unextend the Web Application 

1. Go to Central Administration and select Manage web applications

2. Choose the web application you want to change, and carefully pull the arrow down under Delete in the ribbon (you don't want to delete it)

3. Choose Remove SharePoint From IIS Web Site from the menu

Remove-Ribbon.jpg 

4. Pick the correct zone (it almost all cases you should only have one) and select Yes to Delete IIS web sites

Remove.jpg 

5. Clicking OK will delete the IIS web site only, and not the content database

Rextend the Web Application

1. With the web application still selected, choose Extend from the ribbon

Extend-Ribbon.jpg 

2. Choose the correct zone (ideally the Default zone) and enter the correct port, host header, path, anonymous, and SSL selections

Extend.jpg 

3. Clicking OK will create the new IIS site with the correct bindings, and update SharePoint appropriately.

Note that if you are implementing SSL, you may need to apply your SSL certificate in IIS to complete this process.  Also confirm that the Search Content Source is updated with the new URL, and any customizations or web.config changes are reapplied on the new site.

Setup Redirects

People may have bookmarked links to the original URLs, or links in document or emails.  To avoid them getting a Page can't be displayed error, a redirect should be setup for the previous URL.  This can be done easily in IIS.

  1. Create a new site in IIS 
  2. Go to the HTTP Redirect section
  3. Enter the new URL as the destination
  4. You can either redirect all requests to the same URL (typically the home page), or relative so that the deep links still work
  5. Typically this would be set as a permanent (301) redirect

 HTTP-Redirect.jpg