Sometimes you will have a requirement to rebrand your site with a new domain name for various business reasons. We had a business case a little over a month ago wherein we had to change the brand for our intranet. The requirement was that users visiting the old site would get redirected to the new site automatically. History: We had migrated our SharePoint 2003 intranet to MOSS 2007 and we now wanted to give it a new brand to drive excitement and adoption.
Here is a slick way that I devised to achieve this switch easily. This worked like a charm so if you have a similar business case, test this to decide if this will meet your needs. The URLs and Website names are made up, but they serve to demonstrate how this is done.
We had 2 Web applications for the intranet (one for the main portal and one for MySites). The DNS names were oldintranet.ihs.com and mysite.oldintranet.ihs.com, as an example.
The new DNS names we decided to go with were newintranet.ihs.com and mysite.newintranet.ihs.com.
Here are the steps:
1) On the target server, assign 2 new IP addresses. This is because you can only have one SSL Website enabled on one IP. Create 2 new Web applications (a collaboration portal for newintranet.ihs.com and a MySite for mysite.newintranet.ihs.com) on these 2 new IPs.
2) Procure and attach the appropriate certificates to these Web applications (if using SSL). Create the relevant site collections for these Web applications. Make sure that the new web applications work correctly when you browse to them.
3) Make sure to save the certificates as text files on the C: or D: drive for all the 4 Web applications involved.
--- So now we have a total of 4 IIS Websites. Lets assume these are called MOSS_IHS_Intranet_Old and MOSS_IHS_Intranet_Old_Mysite and MOSS_IHS_Intranet_New and MOSS_IHS_Intranet_New_Mysite. ---
--- Here is where you will have a few minutes of downtime, so do this during a maintenance window ---
4) Go to central administration and change alternate access mappings for newintranet.ihs.com to newintranet2.ihs.com. Similarly change alternate access mappings for mysite.newintranet.ihs.com to mysite.newintranet2.ihs.com. (We change these to arbitrary names so that some other Web application can claim the names that we are changing).
5) Now change alternate access mappings for oldintranet.ihs.com to newintranet.ihs.com and mysite.oldintranet.ihs.com to mysite.newintranet.ihs.com. (Now we change the old headers to the new ones so that the new headers serve content for the old Web application - which is where the content lives anyway. MOSS will do the heavy lifting of changing all the links served on pages to the new URLs we just applied. An exception to this is hard coded links in the Content Query and/or the Links Web Parts).
6) Similarly, now change alternate access mappings for newintranet2.ihs.com to oldintranet.ihs.com and mysite.newintranet2.ihs.com to mysite.oldintranet.ihs.com. (Now we claim those old headers for the new sites so that the old url effectively points to the new Web applications - which have little to no content. We will use these old host headers to merely redirect users to the new URLs).
-- So far we have only done half the work --
7) Go to IIS, right click on the old Website MOSS_IHS_Intranet_Old, click on the Web Site tab and click on Advanced. Here change the host header value from oldintranet.ihs.com to newintranet.ihs.com. This is to match in IIS what we did with alternate access mappings so everything is in sync. Do this for all 4 IIS Websites in question.
8) Change the certificates in IIS. As the host headers were mismatched, so are the certificates. Right click on Website, click Properties and browse to the Directory Security tab. Click on Server Certificate --> click next --> Remove the current certificate. Then attach the certificate that matches the newly changed host header from your hard drive (these were saved in step 3). Do this for all 4 IIS Websites.
9) Swap IPs between the corresponding Web applications. In IIS, right click on Website --> Properties --> Web Site tab --> Advanced --> change IP for both the "Multiple identities for this Web site" as well as "Multiple SSL identities for this Web site". For example, swap IPs between MOSS_IHS_Intranet_Old and MOSS_IHS_Intranet_New as well as between the MOSS_IHS_Intranet_Old_Mysite and MOSS_IHS_Intranet_New_Mysite. This is done to preserve the original IP mappings that we had after step 2. This also helps in keeping the same IP address for the old site and the new site. The new DNS names could then be pre-advertised so that after you are done with this step the old content is being surfaced using the new host header. No funny DNS entry changes required at the last minute.
Now you are done.
10) Now finally add a redirection to the old host headers (newly created Websites) so that they exist merely to redirect all requests to the new host headers (attached to the old Websites where the old content will be surfaced). Go to IIS --> right click on newly created Websites --> Properties --> Web Site tab --> "The content for this resource should come from: --> Select "A redirection to a URL" and specify the URL to be the corresponding new host header. (Do this for both the new Websites.)
You are done. This method may sound complicated, but its not - if you understand what is going on. What we have effectively done is switched which host headers are responding to which content. So now when you browse to the old url, you are automatically redirected to the new url which is serving the old content - the links are automatically changed.
This also helps in house keeping. Once the new url has been sufficiently advertised, you are free to delete the Web applications that are serving the old url, because they point to the new content - which is meaningless for your purpose anyway.
Realize that there are other methods of achieving this goal, but this works pretty well and has the advantages listed above.