amazon web services - AWS Route53 Trying To Get Site To Resolve To www -
so have domain nameservers pointed aws route 53. site hosted on ec2 instance , reachable resolves site.com, if input www.site.com. i'm curious how site resolve www.site.com. have under route53 domains hosted zone 2 additional record sets outside of ns , soa:
a site.com ec2 elastic ip
cname www.site.com ec2 public dns
i can reach site using both site.com , www.site.com, resolve site.com. there way make if enter either, resolves www.site.com?
at first, both should record set.
a site.com ec2 elastic ip www.site.com ec2 elastic ip
and need redirect setting in web server (nginx, apache, ..) following. (source: how redirect www non-www nginx on centos 7)
redirect non-www www
if want redirect users plain, non-www domain www domain, add server block:
server { server_name example.com; return 301 $scheme://www.example.com$request_uri; }
save , exit. configures nginx redirect requests "example.com" "www.example.com". note there should server block defines www web server.
Comments
Post a Comment