The Apache SSI (server Side include), commonly referred to as "server-side embedding" or "server-side inclusion," is a server-based web-making technology similar to ASP.
The default extension is. stm,. shtm and. shtml.
In technology, SSI is a static HTML file that inserts different content depending on the requirements.
For example, a article channel, each article inside the page generates a static HTML, so that when the header of a location needs to be modified, you need to regenerate all the article static HTML files.
If you use SSI, you can embed frequently changing shared parts, such as login messages, in HTML files by commenting lines. You do not need to regenerate all the article, the server will automatically generate Web pages based on embedded files, output to the browser, if you want to modify the only need to modify the embedded file, do not have to regenerate all the HTML files, the server contains this way with PHP include similar.
Open SSI
sudo a2enmod include
Add an SSI extension file to the <Directory></Direcotry> of the site configuration file, using the. shtml
AddType text/html. shtml
addoutputfilter INCLUDES
Options shtml//INCLUDES no exec is required to append content such as include Then use the IncludesNOEXEC
Example 1: Simple embedding
header.php
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
footer.php
<p style= "color: #FFFF00; Background: #CCCCCC; " > This is footer</p>
</body>
Index.shtml
<!--#include file= "header.php"-->
<p> article content, such as normal inclusion can see header and footer. </p>
<!--#include file= "footer.php"-->
If you normally see the following screen: