1. Confirm loading the Include.so module and remove the annotation:
LoadModule Include_module libexec/apache2/mod_include.so
2. The AddType section removes these two paragraphs of annotations:
AddType text/html. shtml
Addoutputfilter INCLUDES. shtml
3. Directory directory permissions found inside
Options Indexes FollowSymLinks
Add includes modifications to:
Options Indexes followsymlinks Includes
4. Restart Apache, test:
<!– #include file= "head.html" –>
Holle word!, this is the middle of the content
<!– #include file= "foot.html" –>
This is supplemented by other netizens:
What is SSI?
SSI is the abbreviation of English server Side includes, translated into Chinese is the meaning that server side contains. From a technical standpoint, SSI is a command or pointer that is in an HTML file that can be invoked through a comment line. SSI is powerful, with a simple SSI command that enables content updates throughout the site, dynamic display of time and dates, and the execution of complex functions such as shell and CGI scripts.
How do you enable your Apache server to support SSI?
Apache does not support SSI by default, and we need to change httpd.conf to configure it. Here I take the Windows platform Apache 2.0.x For example, open the httpd.conf file under the Conf directory, search for "AddType text/html. shtml", search results:
Copy Code code as follows:
# AddType text/html. shtml
# Addoutputfilter INCLUDES. shtml
Remove the # in front of these two lines.
Then search "Options Indexes followsymlinks"
Add "Includes" after the search to the line
The line will change to Options Indexes followsymlinks Includes
Save httpd.conf, and start Apache again.
This completes the setup of the Apache SSI.