SSI (server Side Include), commonly referred to as server-based embedding, is an ASP-like server-based Web-making technology. Most, especially unix-based platform-based Web servers, such as Netscape Enterprise Server, support SSI commands.
ssi Working principle:
£ in one usually with. In an SSI file with a shtml extension, the standard HTML encoding is sent directly to the browser, while an SSI command in the embedded Perl language is first interpreted by the Web server, and if it is standard output, the output information will be sent to the browser as standard HTML.
ssi Simple Application Example:
〈html〉
〈head〉〈title〉my-A-SSI page〈/title〉〈/head〉
〈body〉
You are welcome to visit this website (in 〈!--# echo var= "date_local"--〉).
〈/html〉
The "〈!--#--〉" structure in the above document indicates that the SSI command is executed by the server, not directly to the client. We can observe the source code in the browser with "view → source file":
〈html〉
〈head〉〈title〉my-A-SSI page〈/title〉〈/head〉
〈body〉
You are welcome to visit this website (at Dec 06 1999).
〈/html〉
We found that the HTML in the document was passed directly to the client, and the SSI command was executed. The SSI code is not visible to the client, and the client can only see the effect it performs.
A more practical example
Website maintenance often encountered a problem is that the structure of the site has been fixed, but in order to update a little content and have to redo a large number of pages. SSI provides a simple, effective way to solve this problem, it will be the basic structure of a Web site in a few simple HTML files (templates), we have to do is to upload text to the server, so that the program to follow the template to automatically generate Web pages, so that the management of large Web sites becomes easier. Such as:
The frequent updates are placed in the News.txt, and SSI includes the content to the output page through the include directive. The FLASTMOD directive allows you to display the last change date for new.txt in a Web page.
Building an environment for learning SSI
There are many Web servers that support SSI, such as OMNIHTTPD ProfeSSIonal, an SSI-enabled Web server under the win 95/98 platform. This shared software can be downloaded directly from the http://www.omnicron.ab.ca/httpd/.
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.