提问人:Geo B 提问时间:11/15/2023 最后编辑:Geo B 更新时间:11/16/2023 访问量:15
Htaccess 重定向 — 特定域的 HTTP 和 HTTPS 到另一个域
Htaccess redirect — both HTTP and HTTPS of particular domain to another domain
问:
我管理特定域到另一个域的重定向。我需要重定向 HTTP 和 HTTPS 请求。
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ https://example2.com [L,R=301,NC]
此代码仅适用于 HTTP。
我尝试过类似的东西
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^example.com [NC]
这显然是行不通的! 任何帮助将不胜感激。
PS:https重定向所需的证书可以工作吗?
答: 暂无答案
评论
https://example.com
https://www.example.com