Reputation: 603
I've checked other posts here and can't find anything matching my specific situation.
What I'm trying to do is this (with IIS).
I want visitors to my site, if they request this URL "http://www.example.com/EarlyRegistration" to be automatically redirected to "http://info.example.com/EarlyRegistration" however, that sits on a different server, so I can't simply do it via a virtual directory.
What steps do I need to follow to do this? I'm extremely confused trying to figure it out from MS's documentation.
Upvotes: 0
Views: 48
Reputation: 124
The urlrewrite module for IIS can help with this. Please see the documentation at: https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module
I tried the following rule (obviously with my own urls at the time) and worked
<rule name="Redirect for EarlyRegistration" patternSyntax="ECMAScript" stopProcessing="true">
<match url="EarlyRegistration" />
<conditions logicalGrouping="MatchAny" />
<action type="Redirect" url="http://info.example.com/EarlyRegistration" />
</rule>
What it does: matches the portion after the "/" in the URL to EarlyRegistration. If true, redirects. Make sure this is the first rule you have in the ruleset if you have others.
Upvotes: 1