| 八艾云独立IP主机支持安装SSL证书,也就是可以使用https协议访问网址。 有些用户安装SSL证书后,就产生了http和https都能访问,此时要把http访问跳转到https地址才能充分利用到SSL的加密传输功能。 下面就是设置的方法: 1.将以下代码保存为web.config文件,再上传到FTP的web目录内,即可。 <?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> 2.如果web目录内已有web.config文件,此时上传web.config文件就会覆盖以前的文件,解决方法是直接修改原有的web.config文件,在 <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> |
云主机安装SSL证书后,如何使http跳转到HTTPS地址
八艾云专注为国内站长提供香港空间,香港虚拟主机,云主机,服务器租用