When working with IIS7, the alias (virtual directory path) is defined during site creation but can be modified later through configuration changes. The alias appears in two critical locations within the applicationHost.config file, which controls IIS settings.
The primary configuration file is typically found at:
%windir%\system32\inetsrv\config\applicationHost.config
Yes, you need to update both locations mentioned for consistency:
<application path="/OldAlias" applicationPool="DefaultAppPool">
should become:
<application path="/NewAlias" applicationPool="DefaultAppPool">
Similarly, update the location path:
<location path="Default Web Site/OldAlias">
to:
<location path="Default Web Site/NewAlias">
After making these changes:
- Restart IIS (run
iisreset
from command prompt) - Verify all internal links referencing the old alias
- Check web.config files for path-specific settings
For scripted changes, you can use:
appcmd set app "Default Web Site/OldAlias" /path:/NewAlias
If issues persist:
- Check Windows Event Viewer for IIS-related errors
- Verify NTFS permissions on the physical directory
- Ensure no conflicting bindings exist
When working with IIS7, the alias (or virtual directory path) is stored in two primary locations within the applicationHost.config file:
To update your site alias, you'll need to modify both entries. Here's the complete procedure:
1. Open applicationHost.config (typically located at %windir%\system32\inetsrv\config)
2. Locate both the and nodes
3. Update the path attributes in both sections:
Original configuration:
Modified configuration:
After making these changes:
- Restart IIS (iisreset /noforce)
- Verify bindings if using host headers
- Update any hardcoded references in web.config files
For frequent changes, consider this PowerShell script:
Import-Module WebAdministration
Set-WebApplication -Name "OldWebApp" -Site "Default Web Site" -ApplicationPool "AppPool1" -NewName "NewWebApp"