I have a website say www.mywebsite.com/demo . When ever if anyone requests this site, i want to navigate to another website www.myanotherwebsite.com . I know that this can be done in IIS by using the HTTP Redirect feature. But since i want to do this for different websites, I would like to write a bat file which would run the command to set the redirect url for a website. Can anyone please help me how to set the redirection URL through command line?
Edit: I'm using IIS 7
Look at this PowerShell script
http://forums.iis.net/t/1162778.aspx
Set-WebConfiguration system.webServer/httpRedirect "IIS:\sites\Default Web Site" -Value @{enabled="true";destination="domain.com";exactDestination="true";httpResponseStatus="Permanent"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With