The use of Apache SSI

Source: Internet
Author: User

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:

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.