Share via


How to Change Web Application Name in IIS

For IIS based Web Application , it has been  a known fact  that you are not allowed to edit the application alias from IIS Manager Interface. If you go to editing , The alias of an application has the gray color (not admitted to change). But in this article you may found How to Change Web Application Name in IIS.

But there is an another way to do it. You can edit the settings file as it is written in this article:

First Conider a scenario that you have Original URL as www.contoso.com/iis and now you want it to Change it to www.contoso.com/iis1, then you can opt for the following steps

1) Create a new Subwebsite[Virtual Directory] named iis1 under the Root "Default web Site". Give the Physical path same as iis (Original URL). [ This is Applicable if  it does not have nested Virtual Directories/Applications]

2) You can use Appcmd command  to Rename the Web Application Name [ Applicable if the nested web application is not much high , ususally 3 to 4 web Applications].

%systemroot\%system32\inetsrv\appcmd set app "Default Web Site/iis/xyz" -path:/iis1/xyz [ Renaming the Parent Web App]
%systemroot\%system32\inetsrv\appcmd set app "Default Web Site/iis" -path:/iis1 [ Renaming the Child Web App]

In this case you have to start renaming process from the web application from Child node, otherwise all the nested web application be lost in oblivion. If there are lot of nested web applications then it would be very tough to rename all of them.

3)  Changing the Alias or URL path by  Migrating the Web Application under  the desired Alias Name/ Web Application

The Best way which i have discovered is to migrate the   web Application under  new Alias Name  using Web Deploy Command Line Utility

The Best way which i have discovered is to migrate the web Application under new Alias Name using Web Deploy Command Line Utility. This can be said as Hybrid Method as this is Inplace Migration.
**
Few Words about Web Deploy Tool

The Web Deployment Tool (Web Deploy) is a command-line tool that deploys content and configuration from a user-specified Web site or Web server to a user-specified destination.

Before using this tool ,it has to be downloaded and installed on both the source and destination web servers

Download options and locations**

You can install Web Deploy by using the Web Platform Installer, by running the Web Deploy Windows® Installer, or from the command line by using Msiexec.exe. The Web Platform Installer requires fewer steps, while the other methods allow you to customize your installation. In all cases, you should perform the installation only if you are logged on as an administrator.

Web Deployment Tool Download Locations

 

Platform Location

x86 (32–bit)

Web Deployment Tool (x86)

x64 (64–bit)

Web Deployment Tool (x64)

Once the web Deploy tool is installed, note down your deployment objective.It will be then easier to formulate the web deploy command

Deployment Objective:-

Curent URL Path:www.contoso.com/iis

Requested URL Path: www.contoso.com/iis1

Capture the web application in the form of package via web deploy command

First Step is to Capture the Web Application  in the form of package using Web Deploy command line. Before Running the command please capture the web Application ID from IIS.

msdeploy -verb:sync -source:metakey=lm/w3svc/1/iis -disableLink:ContentExtension -dest:package=c:\iis.zip,encryptPassword="" -enableLink:AppPool >c:\iis.log

Deploy the package to perform inplace Migration
**
Then Run the below Command to Migrate the web Application Named IIS under new Alias IIS1**

msdeploy -verb:sync -source:package=c:\iis.zip,encryptPassword="" -dest:metakey=lm/w3svc/1/iis1 >c:\iis1.log

After the deployment is completed.Read the deployment log(c:\iis1.log)  to see if there  are any errors.If no errors logged , your deployment is completed successfully.

Start using your new URL www.contoso.com/iis1