【发布时间】:2012-08-14 05:02:59
【问题描述】:
我有一个网站。我为我的网站购买了所有 (mydomain.com|net|org|co) 域名。现在,我想将所有请求重定向到 mydomain.com。目前,在我的 httpd.conf 中,我有将 http 请求转发到 https 的重写规则。
For forwarding all http requests to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) @987654321@{HTTP_HOST}%{REQUEST_URI}
我将现有设置与this answer 结合起来,并尝试了以下代码:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) @987654323@{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTP_HOST} !^example.org$
RewriteRule ^ http://example.org%{REQUEST_URI} [L,R=301]
它适用于 http 请求,但不适用于 https(https://mydomain.net/info)。我获得了mydomain.com 的 SSL 证书。它正在向我显示此连接不受信任页面。
处理这种情况的最佳方法是什么。有人可以指导我吗
提前致谢,
死人。
【问题讨论】:
标签: apache mod-rewrite