![](/img/trans.png)
[英]How do I redirect all HTTP requests to HTTPS in ELB without Apache and Nginx
[英]How do I redirect both HTTP and HTTPS to WWW without using htaccess?
我刚刚发布了一个 Python / Flask 无服务器网站(没有.htaccess
),我正在尝试将所有非 www 重定向到 www 。
我使用 NameCheap 作为我的 DNS 注册商,并使用 AWS API 网关为网站提供服务。 我对该网站的主要记录是:
abc012def3456.cloudfront.net
此 CNAME 完美运行; I can access my website at https://www.example.com
or http://www.example.com
(which redirects to the https version).
要将非 www 重定向到 www,我添加了:
https://www.example.com
The thing is, http://example.com
successfully redirects me to https://www.example.com
, but https://example.com
does not . 相反,它只是没有响应。
我究竟做错了什么? Are there any other recommended ways to redirect both http://example.com
and https://example.com
to https://www.example.com
?
您可以使用 AWS 中的弹性负载均衡器将流量从 http 重定向到 https。 下面是文档的链接
https://aws.amazon.com/premiumsupport/knowledge-center/elb-redirect-http-to-https-using-alb/
基本情况是:
快乐加密!
您可以使用 python3-certbot 来自动化这些东西,因为 certbot 是一个 https 安装程序或自动 https 用于网站/服务器,而不是从 Z8052C42AB3B8AA06A3F5F788A4DDCC2 文件中编辑它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.