I have a website comprised of a few static pages hosted on an AWS S3 bucket. I added an A record that maps mysite.com
to the bucket's address (via an alias). I also want users to be able to access my site via www.mysite.com
, but when I add a CNAME mapping www.mysite.com.
to mysite.com
it does not work. What could I possibly be doing wrong?
我有一个由AWS S3存储桶上托管的几个静态页面组成的网站。我添加了一条A记录,将mysite.com映射到存储桶的地址(通过别名)。我还希望用户能够通过www.mysite.com访问我的网站,但是当我添加CNAME映射www.mysite.com时。到mysite.com它不起作用。我怎么可能做错了?
2 个解决方案
#1
1
The domain name has to match the bucket name. The fix is to create a second bucket with www.
in the name, point your www
CNAME to that, and configure that bucket to redirect to the other bucket that contains your website.
域名必须与存储桶名称匹配。修复是用www创建第二个存储桶。在名称中,将您的www CNAME指向该位置,并将该存储桶配置为重定向到包含您网站的其他存储桶。
#2
0
The www.mysite.com
should be an A record pointing to a separate S3 bucket. If you want users to always go to your www
site then you'll put your site files in the www
bucket and setup your top-level domain bucket to redirect to www.mysite.com
.
www.mysite.com应该是指向单独S3存储桶的A记录。如果您希望用户始终访问您的www站点,那么您将把您的站点文件放在www桶中,并设置您的*域名桶以重定向到www.mysite.com。
#1
1
The domain name has to match the bucket name. The fix is to create a second bucket with www.
in the name, point your www
CNAME to that, and configure that bucket to redirect to the other bucket that contains your website.
域名必须与存储桶名称匹配。修复是用www创建第二个存储桶。在名称中,将您的www CNAME指向该位置,并将该存储桶配置为重定向到包含您网站的其他存储桶。
#2
0
The www.mysite.com
should be an A record pointing to a separate S3 bucket. If you want users to always go to your www
site then you'll put your site files in the www
bucket and setup your top-level domain bucket to redirect to www.mysite.com
.
www.mysite.com应该是指向单独S3存储桶的A记录。如果您希望用户始终访问您的www站点,那么您将把您的站点文件放在www桶中,并设置您的*域名桶以重定向到www.mysite.com。