Google Chrome virtual hosts not working with ERR_NAME_NOT_RESOLVED error after update

后端 未结 4 1024
离开以前
离开以前 2021-02-01 07:45

I started getting this error for all my local virtual hosts on apache in the morning when I updated my Chrome to the latest version on ubuntu.

While all of them work on

4条回答
  •  清歌不尽
    2021-02-01 08:04

    Here is how to fix xampp virtual hosts in chrome and firefox that are ending with .dev. who doesn't work anymore (in most versions of chrome, since .dev is real domain registered and reserved from google - [Dev domain ICANN]).

    I had so much trouble, with getting virtual hosts working properly on both firefox and chrome, but at the end i find out that the best solution is to make two different hosts for each local domain. So i ended up with something like: Here is hosts file in (C:\Windows\System32\drivers\etc\hosts):

    This is needed, becouse if you still want your localhost alive

    127.0.0.1 localhost.
    ::1 localhost.
    fe80::1%lo0  localhost.
    

    This works fine in Firefox.

    127.0.0.1 laravel.dev
    ::1 laravel.dev
    fe80::1%lo0 laravel.dev
    

    This works perfectly on Chrome.

    127.0.0.1 laravel.localhost
    ::1 laravel.localhost
    fe80::1%lo0 laravel.localhost
    

    And here is my xampp httpd-vhosts.conf

    
        ServerAdmin webmaster@localhost
        DocumentRoot "D:/xampp/htdocs/"
        ServerName localhost
        ServerAlias localhost
    
    
    
        ServerAdmin webmaster@laravel
        DocumentRoot "D:/xampp/htdocs/laravel/public/"
        ServerName laravel.dev
    
    
    
        ServerAdmin webmaster@laravel
        DocumentRoot "D:/xampp/htdocs/laravel/public/"
        ServerName laravel.localhost
    
    
    
        ServerAdmin webmaster@testsite
        DocumentRoot "D:/xampp/htdocs/testsite/"
        ServerName testsite.dev
    
    
    
        ServerAdmin webmaster@testsite
        DocumentRoot "D:/xampp/htdocs/testsite/"
        ServerName testsite.localhost
    
    

    I hope this helps for someone, because i lost a couple hours, finding out the best solution, and make the things work. :)

    tags - virtual host doesn't work on chrome.

提交回复
热议问题