title: Redirect in one virtual host file affecting all
body: <p>I have a virtual host file with a redirect in it to force requests for the domain to https.</p>
  
  <p>It seems to work <strong>too</strong> well. I added another virtual host file, and all requests for it (:80) are redirected to the first domain on :443. That is, requests for sub.b.com:80 get redirected to a.com:443. Note that b.com is not on the same server, only its sub domain is.</p>
  
  <p><strong>a.com</strong></p>
  
  <pre><code>&lt;VirtualHost a.com:80&gt;
      ServerName a.com
      Redirect permanent / https://a.com/
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost a.com:443&gt;
      ServerName a.com
      DocumentRoot /var/www/html/a
          SSLEngine On
          SSLCertificateFile /usr/local/share/ca-certificates/www.a.com.crt
          SSLCertificateKeyFile /etc/ssl/private/a.com.key
  
          &lt;Directory /var/www/html/a&gt;
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride All
                  Order allow,deny
                  allow from all
          &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p><strong>sub.b.com</strong></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName sub.b.com
      DocumentRoot /var/www/html/b
          &lt;Directory /var/www/html/b&gt;
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride All
                  Order allow,deny
                  allow from all
          &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>