【问题标题】:Changing localhost addr to another addr via windows hosts file - Win 7通过 Windows 主机文件将 localhost 地址更改为另一个地址 - Win 7
【发布时间】:2014-12-29 14:22:27
【问题描述】:

在使用 EasyPHP、Wamp 等程序时,我主要通过在脚本名称前添加 localhost/ 前缀来访问浏览器中的脚本。

我尝试编辑位于 windows/system32/drivers/etc/hosts 中的 hosts 文件并添加以下内容

localhost lh

我希望现在只能输入 lh 而不是 localhost,但重新启动后这似乎不起作用。

这可能只存在于 hosts 文件中吗?

我正在使用 windows 7 专业版

【问题讨论】:

    标签: php windows


    【解决方案1】:
    127.0.0.1 localhost lh
    

    似乎成功了

    【讨论】:

      【解决方案2】:

      是的,这是可能的。您的 NAT IP 的别名。

      127.0.0.1 lh
      

      【讨论】:

        猜你喜欢
        • 2013-02-26
        • 1970-01-01
        • 2017-11-30
        • 2011-09-15
        • 2016-11-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多