1. 程式人生 > >apache http跳轉到https代碼

apache http跳轉到https代碼

start www host amp pan doc engine cond 配置

<VirtualHost *:80>
    ServerAdmin webmasterexample.com
    DocumentRoot "/mnt/www/"
    ServerName www.test.com
    ServerAlias 

    #HTTP_TO_HTTPS_START
    #301-START
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{SERVER_PORT} 80
        RewriteRule 
^(.*)$ https://www.test.com/$1 [R=301,L] </IfModule> </VirtualHost>

在你的網站配置文件*.conf 中修改

apache http跳轉到https代碼