How should I configure the URL Rewrite Rule in IIS7 to redirect my aditional domains ( domain.net, domain.org, domain.info) to the principal .com domain?
Asked
Active
Viewed 4,839 times
3
-
You can use the GUI to setup a redirect in IIS7 per [this](http://www.trainsignaltraining.com/windows-server-2008-http-redirection/2008-03-27/) post. – notandy Feb 23 '09 at 21:42
1 Answers
2
In IIS7, you can use the new command “appcmd.exe” to enable redirection as following:
%windir%\system32\inetsrv\appcmd set config "Default Web Site/" -section:system.webServer/httpRedirect -enabled:true -destination:"http://domain.com"
This tells IIS to redirect all request sending to the virtual application “/” to “http://domain.com”. The actual result is that appcmd.exe adds the following section to the web.config file for “/”:
web.config of your domain.net
<system.webServer>
<httpRedirect enabled="true" destination="http://domain.com" httpResponseStatus="Permanent"/>
</system.webServer>

simplyharsh
- 35,488
- 12
- 65
- 73