ServerName yonicimg.com ServerAlias *.yonicimg.com ServerAdmin atrus@atrus.org RewriteEngine on #redirect the subdomain and path to the canonical domain. RewriteCond %{HTTP_HOST} ^(.*?)yonicimg\.com$ RewriteRule (.*) http://%1yonicimage.com$0 [R=302,L] DocumentRoot /var/www/ # shouldn't be needed Options None Includes AllowOverride All Order allow,deny Deny from all ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On