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 do this.
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
Now you want it to Change it to www.contoso.com/iis1, then you can opt for
1) Creating a new Subwebsite[Virtual Directory] named iis1 under the Root " Deafult web Site".Give the Physical path same as iis. [ 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]
appcmd set app "Default Web Site/iis/xyz" -path:/test/xyz
appcmd set app "Default Web Site/iis" -path:/test
In this case you have to start renaming the web application starting 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
Curent URL Path: www.contoso.com/iis
Requested URL Path:www.contoso.com/iis1
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
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