Home IIS.NET Forums IIS 7 and Above URL Rewrite Module HTTP to HTTPS reditecr does not work on initial connection
Last post Jan 07, 2021 03:24 PM by nickmangioros
2 Posts
Jan 06, 2021 03:45 PM|nickmangioros|LINK
Hi,
I have the following script:
<rewrite> <rules> <rule name="Redirect to http" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" negate="false" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" /> </rule> </rules> </rewrite>
However on the initial connection to the web site does not go to HTTPS
example, I type http://www. website.com and it goes to http://www. website.com
once on the site and click on a hyperlink it does go to https://www. website.com/fr
What am I missing to set this to work correctly.
Note: Have tried similar scripts to the one above as well.
Thanks for your help
179 Posts
Jan 07, 2021 05:26 AM|Brucz|LINK
Hi nickmangioros,
I test the rule in my local IIS, it can work. I think it has no problem.
Please enable fail reuqest tracing to trace the request and find the issue.
Best regards,
Brucz
Jan 07, 2021 03:24 PM|nickmangioros|LINK
Thank your for your reply,
I will do this and let you know on my findings.
Nick
2 Posts
HTTP to HTTPS reditecr does not work on initial connection
Jan 06, 2021 03:45 PM|nickmangioros|LINK
Hi,
I have the following script:
<rewrite>
<rules>
<rule name="Redirect to http" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" negate="false" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
</rule>
</rules>
</rewrite>
However on the initial connection to the web site does not go to HTTPS
example, I type http://www. website.com and it goes to http://www. website.com
once on the site and click on a hyperlink it does go to https://www. website.com/fr
What am I missing to set this to work correctly.
Note: Have tried similar scripts to the one above as well.
Thanks for your help
179 Posts
Re: HTTP to HTTPS reditecr does not work on initial connection
Jan 07, 2021 05:26 AM|Brucz|LINK
Hi nickmangioros,
I test the rule in my local IIS, it can work. I think it has no problem.
Please enable fail reuqest tracing to trace the request and find the issue.
Best regards,
Brucz
2 Posts
Re: HTTP to HTTPS reditecr does not work on initial connection
Jan 07, 2021 03:24 PM|nickmangioros|LINK
Thank your for your reply,
I will do this and let you know on my findings.
Nick