How to quickly and conveniently edit the host file _ PHP Tutorial

Source: Internet
Author: User
How to quickly and conveniently edit host files. When developing web programs, you can modify the hosts file for virtual domain name ING to facilitate local development, for example, when you direct the domain name to a local web program for development, you can modify the hosts file for virtual domain name ING to facilitate local development, for example, if you direct the domain name to the local, this operation is not complicated, but in windows, the hosts file is hidden deeply, in this way, each time we have to Baidu the hosts file path and then open the file directory layer by layer to find the file. if the file is frequently changed, it would be quite troublesome, so here I have summarized a good and slightly master method to share with you.

(1) use text editing software such as Notepad to write the following code:

: Remove the hosts file read-only attribute attrib-r c: \ windows \ system32 \ drivers \ etc \ hosts: Use notepad to edit the hosts file notepad C: \ windows \ system32 \ drivers \ etc \ hosts: add the read-only attribute attrib + r c: \ windows \ system32 \ drivers \ etc \ hosts to the hosts file

Save the file as a. bat File (for example, hosts. bat) with the suffix ).

(2) put the file into the \ WINDOWS \ system32 directory. In fact, this directory does not have to be placed here. you can create a directory at any location, then copy the complete path of the directory to the environment variables of the windows system.

OK. in two simple steps, if you need to modify the hosts file in the future, enter hosts directly in the running state. after you press enter, the system will automatically change the hosts file to writable, and then open the hosts file, the file is automatically changed to read-only when it exits after editing.

Articles you may be interested in
  • Use the GZip compression function of PHP to compress website JS and CSS files to accelerate website access.
  • Bat batch processing and modification of host files
  • Summary of the string truncation function implemented by javascript (including Introduction to the use of Js to intercept Chinese characters)
  • Jquery checks whether the page has been loaded with the jquery file
  • It would be better to load jquery library files with Google
  • PHP uses Curl Functions to Capture webpages and download files with multiple threads
  • PHP is the safest and most practical solution to determine the type of uploaded files
  • Hosts file location and how to open the hosts file


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: 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.