mercredi 24 mars 2021

IIS hosted web application works fine with ssl without www, gives 404 error with www

Good morning. I have a web application (made with angular if useful) hosted with IIS on a windows server 2016 with certificate (made with Let's Encrypts wacs) that works fine with ssl. the problem is, if i use www the site not only appear as not safe, but also gives 404 error. I tried the following rule on web.config to redirect to non www but without success

<rule name="Redirect WWW to non-WWW" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTP_HOST}" pattern="^example\.com$" negate="true" />
      </conditions>
      <action type="Redirect" url="https://example.com/{R:1}" />
</rule> 

I have other rules, thats my complete webconfig file: https://pastebin.com/wRWarfCV




Aucun commentaire:

Enregistrer un commentaire