Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

This virtual host configuration will automatically choose a directory for the site's document root based on the domain name.

<VirtualHost _default_:8080>
  RewriteEngine on

  # Remove "www." from domain names by redirecting.
  RewriteCond %{HTTP_HOST} ^www\.
  RewriteRule ^(.*) %{HTTP_HOST}`$1  [C]
  RewriteRule ^www\.([^\_]*)\`(.*)$ http://$1$2 [R=301,L]

  ServerAlias *.example.com
  UseCanonicalName Off
  VirtualDocumentRoot /var/www/html/workspace/%1/htdocs

  # Make this configuration compatible with Drupal and Pressflow clean URLs.
  <Directory ~ ".*">
    RewriteBase /
  </Directory>
</VirtualHost>
  • No labels