问题
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.
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.
回答1:
You could accomplish this with s3 website redirect[1].
- create a new s3 bucket with the name blog.antrikshy.com
- enable s3 website
- create an alias to blog.antrikshy.com bucket
- enable redirects on your website
- you can create redirects per page as well by creating a key for each page or redirect everything to your homepage
http://aws.amazon.com/about-aws/whats-new/2012/10/04/web-page-redirects-on-amazon-s3-hosted-websites/
来源:https://stackoverflow.com/questions/28388335/how-can-i-redirect-a-request-to-a-subdomain-to-another-subdomain-on-route-53