Website operating principles

Source: Internet
Author: User

The Internet is reaching thousands of households at an unprecedented speed. Many companies or individuals have established homepages and websites on the Internet. Companies publish product information, provide services, and seek commercial opportunities through their websites. individuals can use their web pages to show their talents and hobbies and communicate with others. I wonder if you have considered the question of how the design and creation of a webpage are displayed on a browser? I take the input formats of several different websites as an example to explain how the webpage works.

1. Standard Website: domain name + directory + file name

This is the most standard URL format. For example, enter http://www.yesky.com/zxxw/001.htm, in which www. example is a specific file in this directory. For general HTML files, the web server will directly send the files back to the browser. This most standard URL writing format makes the browser and the Web server only have a file transfer relationship. The specific communication process is:

1. the browser will first find the computer server that stores the web page through a domain name such as www.yesky.com. if it finds the domain name, the browser will contact the server and establish an information transmission channel for correct information transmission.
2.after the information channel is established, the browser will request the server to download the file 001.htm under the zxxwdirectory.
3.after the file is successfully downloaded, the browser will interpret the HTML tag in the 001.htm file. If there is an image, the image file will be downloaded and displayed in the browser window together.

2. Only "Domain Name + directory" URLs

If the browser wants to query a directory, the web server will determine whether the directory contains the default file. If yes, it will pass the default file to the browser. If no, it will pass the directory file list to the browser. For example, the http: // www. Taobao sub-directory contains the local file index.html, and the default file is not placed in the news2 directory. Enter the first URL in the browser address box. Once the connection is successful, the server transfers the default file back to the browser end and finally explains how to execute the file. Enter the second URL, the returned file list in the directory is similar to FTP. If the server does not allow the browser to access the file directory, the browser will display a message indicating "the file list cannot be accessed", indicating that the specific file name to be downloaded must be specified in some settings on the server, if no file is found in the browser, other files or subdirectories cannot be downloaded.
3. Only domain name URLs

In fact, the most popular URL format is probably counted. It is equivalent to http://www.yesky.com/,#@60=http://www.yesky.com?#@62### //#. When we input the above URL into the browser address box, the browser first gets in touch with the computer server and establishes a communication channel, and then sends a request to the server for downloading the website webpage. The server downloads the file index.html under the server root directory because the file name is not explicitly downloaded. Therefore, once a download request is received, the server automatically transmits the file back to the browser. The last page view starts the Execute function to interpret and run the index.html file, and displays the final execution result in front of the user.

4. website containing programs

If the browser wants to download a script program with the extension ASP or CGI, the web server automatically starts the interpreter and returns the execution result to the browser. For example, http: // www. yesky.com/test.aspd' Network Termination is not a. html extension, but. ASP is the extension, test. ASP is an executable program, and the browser cannot interpret it, so it can only be interpreted on the server first, if the program contains parameters such as http://www.yesky.com/test.asp? Name = zys & age = 21 (name and age are parameters). These two parameters are used during execution, and the server returns the running results to the browser. If an HTML Tag is displayed in the result, the browser starts the interpreter and displays the webpage content in front of the user as required by the HTML Tag.

 

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.