700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > IIS7设置http跳转到https重定向的方法

IIS7设置http跳转到https重定向的方法

时间:2020-01-27 06:48:19

相关推荐

IIS7设置http跳转到https重定向的方法

配置好了https站点后,还需要设置301跳转,http站点跳转到https站点。先下载安装URL重写模块:Microsoft URL Rewrite Module

32位URL重写模块下载:/download/4/9/C/49CD28DB-4AA6-4A51-9437-AA001221F606/rewrite_x86_zh-CN.msi

64位URL重写模块:/download/4/E/7/4E7ECE9A-DF55-4F90-A354-B497072BDE0A/rewrite_x64_zh-CN.msi

下载对应的文件在服务器上安装好后,新建web.config文件,内容如下

<?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$" /></conditions><action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /></rule></rules></rewrite></system.webServer></configuration>

将web.config放在网站根目录后,重启IIS即可

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。