i have a domain, say example.com and I host web site using the Apache web server
my website config file (/etc/apache2/sites-available/example.com) looks as follows:
Code:
<VirtualHost example.com:80>
ServerName example.com
#ServerAlias www.example.com
DocumentRoot "/var/www/sites/example.com/current/public"
ErrorLog "/var/log/apache2/example.com-error_log"
CustomLog "/var/log/apache2/example.com-access_log" common
<Directory "/var/www/sites/example.com/current/public">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
# Remove the www
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
</VirtualHost>
The website responds to example.com address but doesn't respond to
www.example.com
Am I missing something?