Amazon Web Services

Playing with www and non-www in AWS using Route53

Written by Deep

In AWS EC2 sometime we  need to redirect our domain from www to non-www version or vice-versa. We can do this with the help of Route53 and htacess file on your server.

Redirect your domain to –

  • You need to create a new record set of CNAME:
    Go to Route53 > Hosted Zones > Slecect Your domain and Create a New Record set with following details :
    (Please replace with your domain name)

           Type: CNAME
           Alias: No
           TTL (Seconds): 300

           and save it.

  • Add .htaccess file to root directory of your domain


Redirect your domain to

  • In Route53 create a Type A (alias) record set (for
    On the EC2 instance /etc/httpd/conf.d/vhost.conf create an entry that redirects all traffic to


1 Comment

Leave a Comment