amazon-web-services - 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 网页。如果存在这样的技术,有人可以指导我学习什么,学习什么?非常感谢。
解决方案
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.
推荐阅读
- swift - Safari App Extension 与包含应用程序通信的方式
- java - Java Stack 推送写入方法 - 目前得到奇怪的输出
- react-native - Firebase 和 React Native Flatlist 之间的 JSON 格式
- android-contacts - 从双卡中获取所有联系人
- c# - 创建具有固定大小数组的不安全结构时,该数组是否初始化为默认值?
- wordpress - Typeform 隐藏参数
- rest - POST方法中的授权使用放心
- c# - 在其加载的事件 WPF 中停止渲染窗口
- java - json数组上的foreach
- magento - 在 magento 2 中显示自定义客户表单