How to customize the test domain name locally during website development

Source: Internet
Author: User

This article from network: http://blog.163.com/kmpaswxq_6651888/blog/static/18032394201132415322540/

During website development, you need to browse the editing effect on the local computer. You need to open a host in the local IIS. Generally, we use the default port 80 of IIS, enter "localhost" or "127.0.0.1" in the browser to access the service. However, different ports, such as 81 and 82, need to be used to open multiple hosts, after this, it will be a bit messy, sometimes dueProgramThe port cannot be identified, causing some errors. Can we customize the test domain name locally? For example, to create a mall, bind a Host Header: shop.test.com in IIS to make a friend website, bind a Host Header: friend.test.com in IIS, and then in the test, enter shop.test.com or friend.test.com in the browser. The answer is yes. The specific method is as follows:

Open the file c: \ windows \ system32 \ drivers \ etc \ hosts, and add the following at the end of the file:
127.0.0.1 shop.test.com
127.0.0.1 friend.test.com

After saving the file, you can bind it to IIS. With this method, it is much easier to develop portal websites with sub-station systems, you can directly add the official domain name and its Substation domain name to this file, so that the local test and Internet test results are the same.

It must be noted that the domain name of this method must be added one by one and does not support wildcard domain names. If you want to use wildcard domain names, you can use bind, it is an open-source cross-platform DNS server software. You need to install and configure the file (under c: \ windows \ system32 \ DNS \ etc). For details, refer to Baidu.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.