1

Any one have any idea why does my domain works if I type mydomain.com to address bar but doesn't work if I type www.mydomain.com?

I am using amazon's EC2 service.

bamya
  • 416
  • 1
  • 6
  • 15
  • The question's description is too short. It would greatly help if you could provide more details such as the web server being used, any other Amazon Web Service such as Route53, ELB, etc being used and so on. It would also help if you could paste your web server configuration here. – rhetonik Jan 03 '13 at 09:43
  • Could you explain whether you want your website as domain.com or www.domain.com. You essentially do a forward to the required domain name. – Naveen Vijay Jan 03 '13 at 10:30
  • Can you check the SOF question [Static hosting on Amazon S3 - DNS Configuration](http://stackoverflow.com/q/8312162/649408) – Naveen Vijay Jan 03 '13 at 10:55

1 Answers1

5

If you are using Route 53 of AWS; we can create an alias and configure so that non-www is redirected to www. The record-set you need to create on Route 53 is suppose example.com [ blank in the first text box]. Type as A. Alias as Yes. Alias Target as www.example.com. Routing Policy as Simple.

If you are not using Route 53; you can use .htaccess file; or creating a filter in your web.xml to achieve same re-direction.

Deepak Singhal
  • 10,568
  • 11
  • 59
  • 98
  • Thanks man, this really helped me get the domain without www running. I've been struggling with it for a while now. – Aayush Oct 21 '13 at 08:40