繁体   English   中英

如何使用 AWS Route53 从子域重定向到域中的 url

[英]How to redirect from subdomain to url in domain using AWS Route53

需要使用 AWS Route53 从 blog.example.com 重定向到www.example.com/blog ,保留查询。

还需要设置智能重定向,即 blog.example.com/articles/slug 到www.example.com/blog/slug

也需要避免双重重定向。

Route53 无法做到这一点。

我建议改为使用 Application Load Balancer 您可以创建基于主机和路径匹配的规则,并路由到特定目标组。

通过将子域指向 Route53(A 记录)和 Nginx 配置中的负载均衡器,设法做到这一点:

server {
    server_name blog.example.com;
    rewrite ^/articles/(.*) https://www.example.com/blog/$1 permanent;

    return 301 https://www.example.com/blog/blog$request_uri;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM