Score:1

My IIS URL Rewrite rule is not working for my IIS website

ru flag

I have an IIS Server on Windows Server 2016 where I host one website.

The site is using bindings so that both of these domains, astro.resources.teams.org and astronomyteams.org, goto to the same website on both http and https.

But that means the user will see either astro.resources.teams.org or astronomyteams.org in the browser depending on their bookmark or what domain they type into the browser.

So now I want both domains, to show as https://astronomyteams.org/

I installed the URL Rewrite module in IIS and added this rule:

    <rule name="CanonicalHostNameRule" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^(.*)$" />
      <conditions>
        <add input="{HTTP_HOST}" pattern="^astro.resources.teams.org$" />
      </conditions>
      <action type="Redirect" url="https://astronomyteams.org/{R:1}" />
    </rule>

But now, a certain large percentage of users getting a not found message when using their old https://astro.resources.teams.org/ bookmarks.

If they type in the astronomyteams.org it works, but I am trying to make it as painless as possible for the end user and I am hoping IIS can take care of this for me.

Is there anything else I need to do to make this work?

Lex Li avatar
vn flag
Check which web browser they use, and then try to reproduce that. Without troubleshooting further you won't find the cause and the solution, because the rule you used looks good enough.
Score:1
ca flag

Try this - set a DNS entry for both "url domains" to point to localhost, or a hosts file entry. 127.0.0.1 astro.res... and next line same with astronomyteams.org . then find out why we had to do this :)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.