时间:2022-04-30来源:www.pcxitongcheng.com作者:电脑系统城
不啰嗦,我们直接开始!
1、购买SSL证书(我用的阿里云的免费证书),然后IIS设置好SSL。
2、如果IIS没有URL重写模块,则需要下载安装URL重写模块:Microsoft URL Rewrite Module
3、取消勾选“SSL设置”-》“要求 SSL”


4、URL重写规则:ASP.NET站可直接修改web.config,和界面操作结果一致,例如:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<?xml version="1.0" encoding="utf-8"?><configuration> <system.webServer> <rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> </rule> </rules> </rewrite> </system.webServer></configuration> |
5、URL重写规则:图形化配置 找到“URL重写”



主要参数
名称:HTTP to HTTPS redirect
模式:(.*)
条件输入:{HTTPS}
模式:off 或 ^OFF$
重定向URL:https://{HTTP_HOST}/{R:1}
重定向类型:已找到(302) 或 参阅其它(303)




通过http访问站点,若自动重定向至https则配置成功!
IIS重写HTTP重定向到HTTPS操作方法
到此这篇关于IIS中设置HTTP访问重定向到HTTPS的文章就介绍到这了
2024-07-07
myeclipse怎么导入tomcat教程2024-07-07
myeclipse如何启动tomcat2024-07-07
myeclipse如何绑定tomcat上线了一个小的预约程序,配置通过Nginx进行访问入口,默认的日志是没有请求时间的,因此需要配置一下,将每一次的请求的访问响应时间记录出来,备查与优化使用....
2023-03-17