Home  >  Q&A  >  body text

localhost and 127.0.0.1

Why can I use 127.0.0.1 to access successfully, but when I use localhost, it shows that I am not on the server?

浅蓝冰粒浅蓝冰粒2441 days ago1584

reply all(1)I'll reply

  • 寻觅 beyond

    寻觅 beyond2018-03-07 11:34:00

    You modify the hosts file of this machine.

    window is under c:\windows\system32\drivers\etc, add 127.0.0.1 localhost

    Linux is under /etc/ Add 127.0.0.1 localhost

    to the hosts file

    reply
    2
  • 浅蓝冰粒

    Thanks! The file has also been modified, but it still does not display.

    浅蓝冰粒 · 2018-03-11 21:11:22
  • Cancelreply