title: SSL certificates installation raises XMLHttpRequest cannot load exception
body: <p><strong>The problem:</strong> </p>
  
  <p>I have 2 websites that have the same IP address (a domain and a subdomain), and I have an SSL certificate for each of them. The domain is a word-press site while the sub domain is a ruby on rails application. the subdomain has the certificate installed and works with no problems, but when I try to add the second certificate for the main domain, it works, but it prevents access to the subdomain.</p>
  
  <p>In the web browser inspection page it shows this error : </p>
  
  <p>“XMLHttpRequest cannot load <a href="https://giladparking.com/wp-content/plugins/wp-slimstat/wp-slimstat-js.php" rel="nofollow noreferrer">https://giladparking.com/wp-content/plugins/wp-slimstat/wp-slimstat-js.php</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="https://monthly.giladparking.com" rel="nofollow noreferrer">https://monthly.giladparking.com</a>' is therefore not allowed access.” </p>
  
  <p><strong>What I have tried:</strong></p>
  
  <p>I have followed <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-multiple-ssl-certificates-on-one-ip-with-apache-on-ubuntu-12-04" rel="nofollow noreferrer">this tutorial</a> to allow for SNI support and it seems to work except for the previously mentioned issue. </p>
  
  <p>I have taken a look at <a href="https://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource">this post</a> as well which explains that you can't make XMLHTTPRequests across domains. but this issue only arises when both certificates are in effect.    </p>