首页 > 解决方案 > Apache 2 不重写 https 流量

问题描述

Apache 2.3 不重写 https 流量,这是我的 htaccess

RewriteEngine On
RewriteCond %{HTTPS} off  
RewriteCond %{HTTP_HOST} ^example.it$ [OR]
RewriteCond %{HTTP_HOST} ^www.example.it$ [OR]
RewriteCond %{HTTP_HOST} ^www.example.com$ [OR] 
RewriteCond %{HTTP_HOST} ^example.org$
RewriteRule ^(.*)$ https://www.example.org%{REQUEST_URI} [R=301,L]

这是site-aviable中的mi example.conf

    AccessFileName .htaccess
    <Directory /www/example.org/>
      Options FollowSymLinks MultiViews
      AllowOverride All
      Require all granted
    </Directory>

但不适用于httpS!仅重写 http 流量

我想如果你写 https:// 或 http:// 或没有 http(s) 一切都重定向到https://www.example.org 怎么办?

此致

标签: apache.htaccessmod-rewritehttps

解决方案


推荐阅读