Using the answer on this page, I was able to configure the rule for myself. I also added query parameters. Want to post it here if this helps someone:
<rule name="Redirect oldsite.com" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^.*oldsite\.com$" /> </conditions> <action type="Redirect" url="http://www.newsite.com/page.cfm?userid=123&mode=form" appendQueryString="false" redirectType="Permanent" /> </rule>
Some pieces of explanation:
To eliminate some confusion, this “url” is the part after the first slash after the domain, not the entire URL. I am going to include this so that it gets any URL.
<match url=".*" />
Now we add the condition because there were several websites on this computer, so I want to make sure that this rule only applies to one of them. I also used a wildcard instead of "(www.)?" because a wildcard will catch any subdomain.
<conditions> <add input="{HTTP_HOST}" pattern="^.*oldsite\.com$" /> </conditions>
And the last note for people who want to add some query string parameters. You will need to avoid the ampersand between them, because it will not work if you do not:
<action type="Redirect" url="http://www.newsite.com/page.cfm?userid=123&mode=form" appendQueryString="false" redirectType="Permanent" />
sugardaddy
source share