About SSI

zhaozj2021-02-12  137

What is the use of SSI? At present, there are several uses:

1. Display server-side environment variables <#echo>

2. Insert the text content directly into the document <#include>

3, display web document related information <#flastmod #fsize> (such as file production date / size, etc.)

4. Directly perform various programs <#exec> (such as CGI or other executable)

5, set SSI information display format <#config> (such as file production date / size display mode)

Advanced ssi can set the variable using the IF condition statement.

Use SSI

SSI is a set of commands provided for web servers that can be embedded directly into the annotation content of the HTML document. Such as:

It is an SSI directive to copy "info.htm" to the current page. When the visitor is browsing, it will see the contents of INFO.htm like the other HTML document.

Other SSI instructions are basically similar to the examples, and it can be seen that SSI use is only inserted into a point, and the form is very simple.

Of course, if the web server does not support SSI, it will simply use it as a comment message, skip them directly; the browser will ignore this information.

How do I configure SSI function on my web server?

On some web servers (such as IIS 4.0 / Sambar 4.2), the file containing the #include command must use the extension that has been mapped to the SSI interpreter; otherwise, the web server will not process the SSI directive; default, expand Name .stm, .shtm and .shtml are mapped to the interpretation program (SSINC.DLL).

Apache is based on your settings, modify SRM.CONF, such as:

AddType text / x-server-pased-html .shtml will only be paired with the .shtml extension file parsing SSI instruction

AddType text / x-server-pased-html .html will parse all HTML documents SSI instructions

The Netscape Web server uses the Administration Server to open the SSI function.

Website uses the Mapping tab in the Server Admin program, the extension adds the content type: WWWSERVER / HTML-SSI

CERN server does not support SSI, available SSI fraud method, to

Http://sw.cse.bris.ac.uk/webtools/fakessi.html Download a Perl script so you can use some SSI instructions. (Do not support EXEC instructions.)

SSI directive basic format

SSI directive basic format:

code:

Welcome to the CGI factory in Zibo hotline. Http://hoyi.zb169.net.

Welcome to the CGI factory in the sub-station of Sun City http://linux.cqi.com.cn/~hoyi.

Welcome to the CGI factory!

Welcome to CGI factory in Zibo hotline http: //hoyi.zb

169.net.

Welcome to the CGI factory in the sub-station of Sun City http://linux.cqi.com.cn/~hoyi.

Welcome to the CGI factory!

Note: The backslash used in the front instruction is used to change the quotation marks inside so that they are not interpreted as ending expressions. Not eliminating.

The reason why it is

SSI, because

SHTML - SERVER-PARSED HTML of the first alphanuner. The HTML text containing the embedded server contains the command. Before being transferred to the browser, the server reads, analyzes, and modifications to the SHTML document.

SHTML and ASP have some similar, in a file named in SHTML, use SSI's instructions, just like the instructions in the ASP, you can write SSI instructions in the SHTML file, when the client accesss these SHTML files,

The server side reads and interprets these SHTML files, interprets the SSI instructions contained in the SHTML file, for example: You can use the SSI directive to reference other HTML files (#InClude) in the SHTML file, the server is transmitted to the client file. It is the Sthml that has been explained does not have an SSI directive. It implements the features of HTML, that is, you can realize

SHTML, can be said to be an evolution of HTML. The news system like Sina is like this, and the news content is fixed but it's the advertisements and menus above it is incorporated by #include.

转载请注明原文地址:https://www.9cbs.com/read-6810.html

New Post(0)