Monday 21 December 2015

Rename website, virtual directory and/or application in IIS 7, 8, 8.5

There is no way to rename a newly created website and an application running beneath via the GUI.
You'd have to delete and recreate your entire site to be able to correct any issue.
However it can be performed from the command line using the appcmd.exe tool.

Start CMD Prompt and ensure you “Run as Administrator” and use the following commands:
                    cd C:\Windows\SysWOW6\inetsrv\
                    appcmd set site ExistingSiteName -name:NewSiteName
Done!
If you need to rename a Virtual Directory
appcmd set VDIR “Default Web Site/oldVDirName” -path:/newVDirName
For Applications under that virtual directory.
 appcmd set APP “Default Web Site/oldVDirName/MyApplication” -path:/newVDirName/MyApplication
To test run the following command to list results.
appcmd list Site
appcmd list VDIR
appcmd list APP

No comments:

Post a Comment