如何在 AWS Route 53 中使用前缀 www 重定向域 [英] How to redirect domain with prefix www in AWS Route 53

查看:64
本文介绍了如何在 AWS Route 53 中使用前缀 www 重定向域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Route 53 中遇到域托管问题.

I have a problem with domain hosting in Route 53.

我需要从 xyz.com 重定向到 www.xyz.com,所以我在 Route 53 上创建了一个托管区域.我添加了一个带有地址的 A 记录我的 ELB,以及一个名称为 www.xyz.com 和我的 ELB 地址值的 CNAME.

I need to redirect from xyz.com to www.xyz.com, so I created a Hosted Zone on Route 53. I added an A record with the address of my ELB, and a CNAME with a name of www.xyz.com and value of my ELB address.

但是这个设置不会将我的裸域重定向到我的 www 前缀域.我该如何解决这个问题?

But this set up does not redirect my naked domain to my www prefixed domain. How do I solve this issue?

推荐答案

我已经使用 S3 和 CloudFront 使其工作.

I've gotten this to work using both S3 and CloudFront.

您需要两个存储桶:www.yourdomainname.comyourdomainname.com.

You need two buckets: www.yourdomainname.com and yourdomainname.com.

将您的文件保存在 www 存储桶中.对于裸域存储区属性,请转到静态网站托管"部分并选择将所有请求重定向到另一个主机名",然后输入 www.yourdomainname.com.

Keep your files in the www bucket. For the naked domain bucket properties, go to the "Static Website Hosting" section and select "redirect all requests to another host name", and enter www.yourdomainname.com.

这篇关于如何在 AWS Route 53 中使用前缀 www 重定向域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆