zoukankan      html  css  js  c++  java
  • 如何在本机上将localhost改为www.dev.com

      windows上安装好服务器后,打开本地目录 C:WindowsSystem32driversetc ,会看到有个hosts文件,打开后里面的代码为:

    # Copyright (c) 1993-2009 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host
    
    # localhost name resolution is handled within DNS itself.
    #    127.0.0.1       localhost
    #    ::1             localhost

    这时我们在最底下添加

         127.0.0.1       www.dev.com

    注意,此时前面不能有分号,这样,当我们访问www.dev.com的时候,其实打开的就是localhost了,即使线上已经有www.dev.com这个域名,打开的也是主机上127.0.0.1这个主机了。

  • 相关阅读:
    模拟http请求 带 chunked解析办法一
    DLL入口函数
    修复吾爱OD数据窗口双击不出现偏移问题
    PE导入表分析
    持仓盈亏公式
    hadoop工作相关
    zookeeper常用命令
    git使用命令行上传文件
    redis中各种数据类型对应的jedis操作命令
    volatile关键字比较好的解释
  • 原文地址:https://www.cnblogs.com/jacson/p/4804622.html
Copyright © 2011-2022 走看看