Using the URL Rewrite module in IIS 10 on a windows server 2022.The rule to redirect http: to https: is not taking any effect (not working) Please read below...
Update: 06/06/2024
Here is what my rule look like.
Note: And the result does not redirect to https: Please read on...
Note: the rule is defined in the web.config
file of the WebAppDemo
web application here: inetpub/wwwroot/WebAppDemo/web.config file
<system.webServer><rewrite><rules><rule name="WebAppDemoHttpsRedirect" stopProcessing="true"><match url="/WebAppDemo(/.*)?$" /><conditions logicalGrouping="MatchAll" trackAllCaptures="false"><add input="{HTTPS}" pattern="^OFF$" /></conditions><action type="Redirect" url="https://{HTTP_HOST}:9443{REQUEST_URI}" /></rule></rules></rewrite></system.webServer>
This does not redirect a http: request to https:
I am not sure what i am missing.I recycled the App Pool for the "Default Web Site" -> WebAppDemo
. Must the "Default Web Site"
be restarted in order for the rule to take effect? I probably don't want to do this...
here is what my setup look like.
Default Web Site WebAppDemo Binding: http:80 url:http://my-host-name.myorg.com/WebAppDemo/Default.aspx New Web Site WebAppDemo Binding: https:9443(custom port) hostName:my-host-name.myorg.com port:9443 Server Name Identifier (Checkbox checked) url:https://my-host-name.myorg.com:9443/WebAppDemo/Default.aspxNote: in both sites, the "WebAppDemo" points to the same physical directory Open browser (chrome)browse: http://my-host-name.myorg.com/WebAppDemo/Default.aspxResult: Does not redirect to the https: site.