進(jìn)入后找下有沒有web.config文件,如果沒有,就手動創(chuàng)建一個(gè) ),如果服務(wù)的是寶塔服務(wù)器nginx配置,只要在ssl欄其它證書打開:強(qiáng)制HTTPS按鈕打開,
而windows配置,需要新建web.config的空的,然后把下面代碼復(fù)制進(jìn)去,保存,然后上傳到網(wǎng)站根目錄下就行,最后測試下打開網(wǎng)址,看下是否會自動跳轉(zhuǎn)到https://www.你的網(wǎng)址名.com形式,如果會,說明配置成功,反之,失敗。
代碼如下:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="http2021426" stopProcessing="true">
<match url=".*"/>
<conditions>
<add input="{HTTP_HOST}" pattern="^boroad.net$"/>
</conditions>
<action type="Redirect" url="http://m.mabhome.com/{R:0}" redirectType="Permanent"/>
</rule>
<rule name="Zkeys-HTTPS-0eI2H6$1" enabled="true" stopProcessing="true">
<match url="(.*)" ignoreCase="true"/>
<conditions>
<add input="{HTTPS}" pattern="^OFF$"/>
</conditions>
<action type="Redirect" url="http://m.mabhome.com{REQUEST_URI}" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1"/>
<error statusCode="404" prefixLanguageFilePath="" path="404.html" responseMode="File"/>
</httpErrors>
</system.webServer>
</configuration>
