首页 > 解决方案 > AWS,将多个域映射到一个网站,但路径不同

问题描述

我想知道是否可以在 aws 上托管一个网站,例如 www.myname.com,然后有可能将不同的域映射到不同的路径。例如:将域 www.hellogeorge.com(只是一个示例)映射到 www.myname.com/george 然后另一个人将他的域 www.otherdomainchristian.com 映射到 www.myname.com/christian

我想说 www.myname.com/name 是一个 api 端点,它根据使用的特定参数生成一个 html 网页。如果存在这样的技术,有人可以指导我学习什么,学习什么?非常感谢。

标签: amazon-web-servicesamazon-route53domain-mapping

解决方案


Well, it's pretty simple to do. You can use S3 bucket static web hosting to do the redirection. For example,

map domain www.hellogeorge.com (just an example) to www.myname.com/george

Create an S3 bucket called www.hellogeorge.com and then set redirection domain/path to www.myname.com/george

then another person to map his domain www.otherdomainchristian.com to www.myname.com/christian

Create another S3 bucket called www.otherdomainchristian.com and then set redirection domain/path to www.myname.com/christian

Now, when a user visits www.hellogeorge.com or www.otherdomainchristian.com, he/she will get a 301 redirection to the corresponding destination.

Next, you can use Amazon API Gateway to generate dynamic response depending on the request parameter.


推荐阅读