I am trying to create a virtual host on XAMPP under Windows 8. I added lines to the file C: \ xampp \ apache \ conf \ extra \ httpd-vhosts.conf:

<VirtualHost *:80> ServerAdmin webmaster@localhost.com DocumentRoot "C:/xampp/htdocs" ServerName localhost </VirtualHost> <VirtualHost mysite.dev:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "C:/WebServers/home/mysite.dev/www" ServerName mysite.dev ServerAlias www.mysite.dev ErrorLog "C:/WebServers/home/mysite.dev/logs/error.log" CustomLog "C:/WebServers/home/mysite.dev/logs/access.log" common </VirtualHost> 

Added line to C: \ Windows \ System32 \ drivers \ etc \ hosts

 127.0.0.1 mysite.dev 

Created folders: C: \ WebServers \ home \ mysite.dev \ www C: \ WebServers \ home \ mysite.dev \ logs

In the folder C: \ WebServers \ home \ mysite.dev \ www put the index.html file

Restarted XAMPP.

After that I try to open the page http://mysite.dev/ and get the error message:

Your connection is not secure.

The owner of mysite.dev has configured your website incorrectly. To protect your information from being stolen, Firefox did not connect to this website.

This site uses the HTTP Forced Secure Connection (HSTS) to indicate that Firefox should connect to it only through a secure connection. As a result, adding an exception to this certificate is not possible.

Firefox for some reason tries to open https, although I explicitly point it to http. Can you please tell me what am I doing wrong? Maybe you need some other settings to change? Installing XAMPP is clean - just installed from scratch, did not change any settings.

  • Try it from another browser or clean the HSTS cache in firefox. - de_frag

1 answer 1

The fact is that Firefox and Chrome automatically redirect traffic from http: // to https: // if you use .dev as the first level domain ( here’s the information and here )

The easiest way to not use the domain .dev

And hosts does not work because the browser takes information about the host from the dns cache; this can be disabled:

  1. Open FF
  2. enter in the address bar about: config
  3. right click on any property select New> Integer in the context menu
  4. Enter in the name - network.dnsCacheExpiration, value - 0
  • In my case, replacing the domain with mysite.localhost or mysite.test helped. And yet nowhere in the error message or in the documentation is not written about this feature. - Andrey Epifantsev