如何将请求重定向到子域到Route 53上的另一个子域?

问题描述:

我在blog.Antrikshy.com上有一个GitHub Pages Jekyll博客.我一直想将其移至code.Antrikshy.com已有一段时间.我将新地址设为Amazon上antrikshy.github.io的CNAME,并正确连接了所有地址以使其正常工作.现在我的blog.Antrikshy.com URL已损坏.如何设置它以将其重定向到新的子域?

I have a GitHub Pages Jekyll blog at blog.Antrikshy.com. I have been meaning to move it to code.Antrikshy.com for a while now. I made the new address a CNAME for antrikshy.github.io on Amazon and wired everything correctly to make it work. Now my blog.Antrikshy.com URL is broken. How can I set it to redirect it to the new subdomain?

我是新来的.如果您需要更多信息,请发表评论.

I'm new to this. Comment if you want any more information.

最好我想执行301重定向并保留整个路径,但这不是很重要.我只是希望它能正常工作,即使这意味着用户将被重定向到新的主页.

Preferably I'd like to do a 301 redirect and also retain the entire path, but that's not very important. I just want it to work, even if it means that users are redirected to the new home page.

您可以使用s3网站重定向[1]完成此操作.

You could accomplish this with s3 website redirect[1].

  • 创建一个名为blog.antrikshy.com的新s3存储桶
  • 启用s3网站
  • 为blog.antrikshy.com存储桶创建别名
  • 在您的网站上启用重定向
  • 您还可以通过为每个页面创建密钥或将所有内容重定向到首页来为每个页面创建重定向

http://aws.amazon.com/about-aws/whats-new/2012/10/04/web-page-redirects-on-amazon-s3-hosted-websites/