一、http自動跳轉https
首先服務器肯定得有ssl證書,新建http和https兩個網站,指向同一個物理路徑
可以在phpstudy中測試,生成開發者證書及測試開啟http自動跳轉https
在配置文件中體現為
apache:
RedirectMatch permanent ^/(.*) https://gpysir.design/$1
nginx:
rewrite ^(.*)$ https://$gpysir.design/$1 permanent
二、除此可以實現301重新向頁面
使用場景:
網站改進,一些url失效,可以全部重新向到新頁面