ServerName ljcode.com ServerAlias *.ljcode.com ServerAdmin atrus@atrus.org RewriteEngine on #redirect the subdomain and path to the canonical domain. RewriteCond %{HTTP_HOST} ^(.*?)ljcode\.com$ RewriteRule (.*) http://%1ljcode.org$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