SSI是英文Server Side Includes的缩写,翻译成中文就是办事器端包括的意思。从手艺角度上说,SSI就是在HTML文件中,可以经由过程正文行挪用的号令或指针。SSI具有壮大的功效,只需利用一条复杂的SSI 号令就能够完成全部网站的内容更新,工夫和日期的静态显示,和履行shell和CGI剧本法式等庞杂的功效。SSI 可以称得上是那些资金充足、工夫严重、任务量大的网站开辟人员的最好副手。本文将次要联合Apache办事器引见SSI的利用办法。
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#AddType text/x-server-parsed-html .shtml
#AddType application/x-httpd-CGI .CGI
注重, 高版本的Apache多是这几行:
#
# To use server-parsed HTML files
#
#AddType text/html .shtml
#AddHandler server-parsed .shtml
# This should be changed to whatever you set DocumentRoot to.
<Directory /usr/local/etc/httpd/htdocs>
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", or "FollowSymLinks"
Options Indexes FollowSymLinks
</Directory>
将个中的Options Indexes FollowSymLinks改成:
Options Indexes FollowSymLinks Includes