Home IIS.NET Forums IIS 7 and Above Configuration & Scripting HTTP Redirect with port number to HTTPS and drop the port number
Last post Jan 20, 2021 01:47 AM by arvvie
2 Posts
Jan 18, 2021 12:47 AM|arvvie|LINK
Hi
Running on IIS 10.
Need help redirecting non-ssl with a port number i.e. http://domainname.com:8090/Foldername and hope to drop the port number and rewrite to https://domainname.com/Foldername.
Please help with the ruleset or any other config that needs to be done to achieve this?
Thanks.
1616 Posts
Jan 18, 2021 06:43 AM|Jalpa Panchal|LINK
Hi,
You could try to use the below rule:
<rule name="HTTP to HTTPS" enabled="true" stopProcessing="true"> <match url="(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> <add input="{HTTPS}" pattern="off" /> <add input="{HTTP_HOST}" pattern="([^/:]*?):[^/]*?" /> </conditions> <action type="Redirect" url="https://{C:1}/{R:0}" appendQueryString="true" /> </rule>
Regards,
Jalpa
1 Post
Jan 19, 2021 07:47 AM|mubaohiemquangcao|LINK
thanks
Jan 20, 2021 01:47 AM|arvvie|LINK
Thank you Jalpa. Worked perfectly. Great solution.
Thanks,
Arvvie
2 Posts
HTTP Redirect with port number to HTTPS and drop the port number
Jan 18, 2021 12:47 AM|arvvie|LINK
Hi
Running on IIS 10.
Need help redirecting non-ssl with a port number i.e. http://domainname.com:8090/Foldername and hope to drop the port number and rewrite to https://domainname.com/Foldername.
Please help with the ruleset or any other config that needs to be done to achieve this?
Thanks.
1616 Posts
Re: HTTP Redirect with port number to HTTPS and drop the port number
Jan 18, 2021 06:43 AM|Jalpa Panchal|LINK
Hi,
You could try to use the below rule:
Regards,
Jalpa
1 Post
Re: HTTP Redirect with port number to HTTPS and drop the port number
Jan 19, 2021 07:47 AM|mubaohiemquangcao|LINK
thanks
2 Posts
Re: HTTP Redirect with port number to HTTPS and drop the port number
Jan 20, 2021 01:47 AM|arvvie|LINK
Thank you Jalpa. Worked perfectly. Great solution.
Thanks,
Arvvie