About SSI (Server Side Include)

Source: Internet
Author: User
Server-side include (server-side include)

Server-side include (included on the server) is a file that is incorporated into your document when a browser requests your document from the server.

When the visitor's browser requests a document containing the include (including) command, the server processes the include (including) command and creates a new document. In the new document, include (including) the command is replaced by the included file content. The server then sends the new file to the visitor's browser. However, when you open a local document directly in the browser, the file is opened without the server being able to process the include (including) commands in the document, and the file that should have been included does not appear in the browser. Therefore, if you do not use Dreamweaver, it may be difficult to see the effect of local files on visitors after they are placed on the server.

By using Dreamweaver, You can preview the display effect of the document after it is placed on the server either in the "design" view or in the browser.

When you place server-side include (server-side include) in the document, a reference to the external file is inserted, but it does not insert the content of the specified file in the current document. Dreamweaver displays the content of external files in the "design" view, making the page design easier.

You cannot directly edit included files in the document. To edit the content of server-side include, you must directly edit the files you include. Note that any changes to an external file are automatically reflected in every document that includes the file.

There are two types of server-side include (server-side include): "virtual" type and "file" type. Select a type that corresponds to your web server type:

  • If your server is an Apache web server, select "virtual ". In Apache, "virtual" applies to all situations, while "file" only applies to some situations.
  • If your server is Microsoft Internet Information Server (IIS), select "File ". ("Virtual" can only be used for IIS in certain circumstances .)

    Note:

     

    Unfortunately, IIS does not allow you to include files in folders higher than the current folder in the folder hierarchy unless special software has been installed on the server. If you want to include files from a higher level folder in the folder hierarchy on the IIS server, contact your system administrator to check whether necessary software is installed.

  • For other types of servers, or if you do not know which type of server you are using, contact your system administrator for the options you want to use.

Some servers are configured to check all files to see if they contain server-side include (included on the server side). Other servers are configured to only check files with a specific file extension, for example. shtml ,. SHTM or. inc. If a server-side include (included on the server) does not apply to you, ask your system administrator if you need to use a special extension in the name of the file that uses include (included. (For example, if the file name is canoe.html, you may need to rename it canoe.shtml .) If you want your file to be retained. HTML or. HTM extension. Please ask your system administrator to configure the server to check all files (not just files with a certain extension) whether server-side include exists ). However, it takes more time for the server-side include (server-side include) analysis file to be used. Therefore, the pages on which the server analyzes may be used a little later than other pages; therefore, some system administrators do not provide the option to analyze all files.


How SSI works: before sending content to a browser, you can use the "server-side inclusion (SSI)" command to include text, graphics, or application information to a webpage. For example, you can use SSI to include a time/date stamp, a copyright statement, or a form for the customer to fill in and return. For text or graphics that repeatedly appear in multiple files, using include files is a simple method. You can store the content in an contained file without entering the content into all files. You can use a very simple statement to call the inclusion file, which instructs the Web server to insert content into an appropriate webpage. In addition, when a file is included, all changes to the content can be completed in one place. Because files containing SSI commands require special processing, the SSI file extension must be assigned to all SSI files. The default extensions are. stm,. shtm, And. shtml.

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.