如何在AWS Route 53中将流量从非www域名重定向到www.example.com [英] How to redirect traffic from non www domain name to www.example.com in AWS Route 53

查看:62
本文介绍了如何在AWS Route 53中将流量从非www域名重定向到www.example.com的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AWS Route 53'www.derbyware.com'中拥有一个域名,我有一个运行在' http://node147934-env-7029269.phx.enscaled.us ".现在,对于我的用户,我希望他们使用www.derbyware.com访问Web应用程序,而不是丑陋的URL' http://node147934-env-7029269.phx.enscaled.us ".我成功地使www.derbyware.com成为Web应用程序的域名.现在非www'derbyware.com'无法正常工作.

I own a domain name in AWS Route 53 'www.derbyware.com', I have a web application running at 'http://node147934-env-7029269.phx.enscaled.us' on Jelastic. now for my users I want them to access the web application using www.derbyware.com not the ugly url 'http://node147934-env-7029269.phx.enscaled.us'. I successfully made www.derbyware.com act as the domain name for the web application. now non www 'derbyware.com' does not work.

您可以测试网址.

推荐答案

这是来自AWS Support的解决方案

This is the solution from AWS Support

解决方案:

使用以下过程重定向您的域.在此示例中,我们将example.com重定向到example.net.

Use the following procedure to redirect your domain. In this example, we redirect example.com to example.net.

要求:

  • 域example.com的托管区域托管在Amazon Route 53中.
  • 您有权将资源记录添加到example.com的托管区域.
  • 您有权创建Amazon S3存储桶.
  • 您可以使用example.com的确切名称创建一个S3存储桶.

注意:这些站点必须是HTTP,因为重定向无法通过HTTPS连接到S3.

Note: The sites must be HTTP, because the redirect cannot connect to S3 over HTTPS.

  1. 在Amazon S3控制台中,创建一个名称确切为example.com的S3存储桶.

注意:S3存储桶名称必须是全局唯一的.如果您需要的存储桶名称已在使用中,则无法使用此解决方案.

Note: S3 bucket names must be globally unique. If the bucket name you need is already in use, this solution cannot be used.

  1. 选择刚创建的存储桶,然后选择属性".展开静态网站托管"下拉菜单,然后选择将所有请求重定向到另一个主机名".
  2. 在将所有请求重定向到另一个主机名"字段中,输入example.net,然后选择保存".
  3. 在Route 53控制台中,选择名为example.com的托管区域.
  4. 使用以下值为example.com创建资源记录:

  1. Choose the bucket you just created, and then choose Properties. Expand the Static Website Hosting dropdown menu, and then select Redirect all requests to another host name.
  2. In the Redirect all requests to another host name field, enter example.net and then choose Save.
  3. In the Route 53 console, select the hosted zone named example.com.
  4. Create a resource record for example.com with the following values:

  • 记录类型:选择一个IPv4地址.
  • 别名:选择是.
  • 别名目标:选择空白值字段,展开下拉菜单,然后在标题S3网站端点下选择您的S3存储桶.
  • 路由策略:选择简单.
  • 评估健康目标:选择否",然后选择创建".注意:下拉菜单可能需要一些时间来填充您的存储桶名称.

您现在应该能够将example.com重定向到example.net.您可以通过浏览到example.com或CURL到example.com来确认这一点.您应该在curl输出中看到"301已永久移动",并重定向到example.net.

You should now be able to redirect example.com to example.net. You can confirm this by browsing to example.com or CURL to example.com. You should see "301 Moved Permanently" in your curl output, redirecting to example.net.

这篇关于如何在AWS Route 53中将流量从非www域名重定向到www.example.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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