ServerAdmin admin@domain.tld NameVirtualHost *:80 NameVirtualHost *:443 ServerName domain.tld DocumentRoot /var/www/base_http DirectoryIndex index.html index.html.var index.php UseCanonicalName Off # Logging # HostnameLookups On LogFormat "%h %t %{Referer}i -> %U -- %{User-agent}i" details ErrorLog /var/log/httpd/error_log CustomLog /var/log/httpd/access_log common CustomLog /var/log/httpd/details_log details # Main site declaration # Options Indexes FollowSymLinks MultiViews AllowOverride All Order deny,allow Allow from all # Block TRACE/TRACK XSS vector RewriteEngine On RewriteCond %{REQUEST_METHOD} ^TRAC(E|K) RewriteRule .* - [F] ForceType application/x-httpd-php DavLockDB /var/httpd/DavLock Include "/usr/pkg/etc/httpd/vhosts.conf" # SEE PASTE http://pastebin.ca/79164 # Main server ServerName domain.tld ServerAlias www.domain.tld domain.tld *.domain.tld DocumentRoot /var/www/base_http VirtualDocumentRoot /var/www/base_http RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.domain.\.tld$ [NC] RewriteRule ^(.*)$ http://smurfturf.net$1 [R=301,L] # This is important so that the ssl server always uses ssl RewriteCond %{HTTP_HOST} ^secure\.domain\.tld$ [NC] RewriteRule ^(.*)$ https://secure.domain.tld$1 [R=301,L] # Block TRACE/TRACK XSS vector RewriteCond %{REQUEST_METHOD} ^TRAC(E|K) RewriteRule .* - [F]