I am using AWS EC2 and I am redirecting example.com domain to a directory in EC2 with the following virtual host:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com *.example.com
<IfModule mod_rewrite.c>
RewriteEngine on
# WITH 'www.'
RewriteCond %{HTTP_HOST} !^www.(.*) [nocase]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}$1 [redirect=permanent,nocase,last]
</IfModule>
DocumentRoot /var/www/html/Example
</VirtualHost>
Now it when I go to www.example.com it is working correctly. However, using the naked domain http://example.com I get the following error:
Failed to load resource: the server responded with a status of 404 (Not Found)
GET http://peep.ie/ net::ERR_NAME_NOT_RESOLVED
This is the DNS configuration:
A *.example.com. xxx.yyy.zzz.ttt 3600 Manual Active Yes