Skip to content

Instantly share code, notes, and snippets.

@eddiemonge
Created May 4, 2011 18:37
Show Gist options
  • Save eddiemonge/955742 to your computer and use it in GitHub Desktop.
Save eddiemonge/955742 to your computer and use it in GitHub Desktop.
Virtual Host Example
<VirtualHost IPADDRESS:PORT>
ServerAdmin real_or_fake@emailaddress.com
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /var/www/html
<Directory "/var/www/html">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
</Directory>
ErrorLog /var/www/logs/site.error.log
CustomLog /var/www/logs/site.access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment