title: Using Domain name instead of localhost in with https in xampp
body: <p>My question may be stupid, But honestly I searched a lot and got success but not complete.</p>
  
  <p>I use xampp with windows 8.</p>
  
  <p>My host file looks as follows.</p>
  
  <pre><code>    127.0.0.1   localhost
      127.0.0.1   www.mysite.com
  </code></pre>
  
  <p>My httpd-vhosts.config looks as follows.</p>
  
  <pre><code>    NameVirtualHost 127.0.0.1
      &lt;VirtualHost 127.0.0.1&gt;
          DocumentRoot "C:/xampp/htdocs"
          ServerName localhost
      &lt;/VirtualHost&gt;
      &lt;VirtualHost 127.0.0.1&gt;
          ServerName www.mysite.com
          ServerAlias mysite.com
          DocumentRoot "C:/xampp/htdocs/mysite"
      &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>This works perfect for http.
  But I have enabled ssl.</p>
  
  <p>When I type <code>http://localhost</code> or <code>https://localhost</code>, Both work fine.</p>
  
  <p>When I type <code>http://mysite.com</code> it works, </p>
  
  <p>when I type <code>https://mysite.com</code> it is redirected as <code>https://mysite.com/xampp/</code> and shows me default welcome page of xampp.</p>
  
  <p>I tried following things.</p>
  
  <p>1) instead of using 127.0.0.1, I tried using *:80 in httpd-vhosts.conf But result was same.</p>
  
  <p>2) instead of using 127.0.0.1, I tried using *:443 in httpd-vhosts.conf But at the time of restarting apache fails to start again.</p>
  
  <p>Please let me know how can I access my site through domain name instead of localhost with https or http.</p>