I know this is an old, and "amateur" question but I see myself in the need of making this question since I truly don't know whats going on.
My website is not accessible with the www prefix... Actually it works sometimes and sometimes it does not. If I access the website without the www then it will suddenly start working with the www.
After "doing my homework" I followed the next steps in order to solve it:
-On my domain name service provider I added a A Record and a C NAME record that points to my website, it literally looks like this, I am assuming that GoDaddy is resolving @ to my web address since I actually hit the website sometimes:
-On my Virtual Host configuration file (httpd-vhost.conf in my case) I have this structure:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot my_htdocs_path
<Directory my_htdocs_path>
Option Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
I have 4 of these blocks, they all work perfectly but the most important one! (Murphy's law stuff).
Whats going on? Can someone please give me a hint?
Additional useful info:
- Running an Amazon EC2
- I'm using Route53 for the subdomain names
- Everything used to work fine