I need to make an 301 Redirect from the web.config on a IIS 6 server (Windows 2003 Web Server). I'm a Apache-server guy, and do not have a clue about Windows Web Servers. I only have access to the server from FTP.
I have found the following in another question, but it does'nt seem to work:
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to WWW" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^mydomain1.com$" />
</conditions>
<action type="Redirect" url="http://www.mydomain2.com"
redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
I need to redirect seperate pages from mydomain1.com to mydomain2.com.
Ex. mydomain1.com/somename should redirect to mydomain.com/someothername
How can this be done?
---- Edit ----
After seeing another thread here on stackoverflow, my configuration now kind of looks like this:
<system.webServer>
<rewrite>
<rule name="rule1">
<match url="default.aspx"/>
<action type="Redirect" redirectType="Permanent" url="http://www.mydomain.com/somename/somename.aspx"/>
</rule>
<rule name="rule2">
<match url="somename.aspx"/>
<action type="Redirect" redirectType="Permanent" url="http://www.mydomain2.com/somename2/somename2.aspx"/>
</rule>
</rewrite>
</system.webserver><br>
--- Edit 2 ---- Code for redirecting the root: