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:
- Unextend by removing SharePoint from the IIS Web site
- Rextend onto a new IIS Web site with the new URL and port information
- 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
4. Pick the correct zone (it almost all cases you should only have one) and select Yes to Delete IIS web sites
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
2. Choose the correct zone (ideally the Default zone) and enter the correct port, host header, path, anonymous, and SSL selections
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.
- Create a new site in IIS
- Go to the HTTP Redirect section
- Enter the new URL as the destination
- You can either redirect all requests to the same URL (typically the home page), or relative so that the deep links still work
- Typically this would be set as a permanent (301) redirect