1. 程式人生 > >443埠 阿里雲配置 Apache SSL證書 .htaccess

443埠 阿里雲配置 Apache SSL證書 .htaccess

443埠 阿里雲配置 Apache SSL證書時,用到.htaccess檔案,此檔案放在網站根目錄下.實現跳轉到https,在記事本輸入以下程式碼後,儲存名字為.htaccess,副檔名是所有檔案.


<IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteBase / 
     RewriteCond %{SERVER_PORT} !^443$
     RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
 </IfModule>