- 工信部備案號 滇ICP備05000110號-1
- 滇公安備案 滇53010302000111
- 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證 B1.B2-20181647、滇B1.B2-20190004
- 云南互聯(lián)網(wǎng)協(xié)會(huì )理事單位
- 安全聯(lián)盟認證網(wǎng)站身份V標記
- 域名注冊服務(wù)機構許可:滇D3-20230001
- 代理域名注冊服務(wù)機構:新網(wǎng)數碼
在安裝證書(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;
}
售前咨詢(xún)
售后咨詢(xún)
備案咨詢(xún)
二維碼
TOP