skip to Main Content

We have a legacy ASP.NET webforms .aspx web application installed under "Default Web Site".

Is it possible to enable https: for just this web application, given that there are other web applications deployed under "Default Web Site"?

All the instructions I found online insist upon creating a https: binding in IIS on port :443

The challenge is, I want to know are there any other possible ways to enable https: for just that one web application without impacting the other applications?

2

Answers


  1. Assuming you are using IIS, the certificate is tied to the IP/Port binding, which is tied to the website; Default Web Site in your case.

    If having a certificate on the site will break applications on the single IIS Site you’re using, I would split the applications out to their own sites.

    Just having the port and cert on the site doesn’t force the site and subsequent apps to use the port and cert so, really, you should be fine.

    Login or Signup to reply.
  2. As @Joe Davis said there is no direct way to set the only one application which is under some website to https by using the binding but there is workaround you could try to achieve your requirement.

    1. Set the site binding to the website as below(you can set hostname ip based on your requirement)

    enter image description here

    2)Then use iis url rewrite rule which can help you to redirect your specific application url to the https and other will be served with http only:

     <rule name="https redirect" stopProcessing="true">
             <match url="appname(/.*)?$" />
             <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                 <add input="{HTTPS}" pattern="^OFF$" />
             </conditions>
             <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" />
         </rule>
         <rule name="http redirect" stopProcessing="true">
             <match url="(.*)" />
             <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                 <add input="{HTTPS}" pattern="ON" />
                 <add input="{REQUEST_URI}" pattern="/appname(/.*)?$" negate="true" />
             </conditions>
             <action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}" />
         </rule>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search