国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

如何設置iis7.0下http跳轉到https

2015-12-22 22:26:00 9549

在安裝證書(shū)完成后,要想實(shí)現輸入域名自動(dòng)跳轉到https,我們還需要通過(guò)添加代碼才能達到效果。不同的操作系統的設置也是不一樣的。

1.Linux主機

如果使用的是Linux主機,需要在你的網(wǎng)站根目錄下的.htaccess文件(沒(méi)有需要創(chuàng )建一個(gè))中添加下面代碼然后保存即可:

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ http://www.tjdsmy.cn/$1 [R,L]

當然,如果想指定某一個(gè)文件使用https,則添加一下代碼(此時(shí).htaccess文件需要放在你指定的文件夾中):

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteCond %{REQUEST_URI} somefolder

RewriteRule ^(.*)$ http://www.tjdsmy.cn/somefolder/$1 [R,L]

2.Windows主機

Windows主機需要在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" ignoreCase="true" />

</conditions>

<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />

</rule>

     </rules> 

</rewrite>

    </system.webServer>

</configuration>

3.nginx web服務(wù)器的設置

server { 

    listen  192.168.1.111:80;  

    server_name test.com;   

    rewrite ^(.*)$  https://$host$1 permanent;  

提交成功!非常感謝您的反饋,我們會(huì )繼續努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題:
-->