這是順子在新公司所學到的,分享給大家參考!
一般而言,以IIS建構網站環境時,我們開發平台的網址是以
http://127.0.0.1/ 或是
http://localhost/
來指向本機。
其實你可以有更多選擇!
我們可以在以下檔案中,為自己的開發測試平台建立屬於自己的網址。
C:\WINNT\system32\drivers\etc\hosts
該檔原始內容如下:
# Copyright (c) 1993-1999 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
127.0.0.1 localhost
你可以在最後加入自己的設定的網址對應,例如:
127.0.0.1 localhost
127.0.0.1 test.shunze.d2g.com
如此一來,test.shunze.d2g.com 也就可以指向127.0.0.1本機位址了。
這個方法適用於windows 2000及windows XP。
如果你有安裝Norton AntiVirus的話,你可以發現Norton也是利用這個方式將pop3.norton.antivirus指向127.0.0.1機位址。
用這個方向來指定本機網址,是不是方便又好用呢!!
(當然這個方法是方便本機測試,對外可行不通喔!)
|
|
♥順子老婆的網拍,請多關照∼
If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!
|