Server Side Includes (SSI)
Server Side Include can be used to allow insertion of an HTML into another. e.g. header or footer can be separated from pages so you only have to change a single file to update the header/footer on all pages of your site.
Here’s a fairly good introduction to SSI although it does miss a few important points:
-
If you are using
.htaccess
to enable SSI for a single folder you may want to add couple of extra lines:Options Indexes FollowSymLinks Includes AddType application/x-httpd-cgi .cgi AddType text/x-server-parsed-html .html
-
A better option is to use the XBitHack:
- Remove from .htaccess anything else relating to SSI
- add
XBitHack on
- set the HTML file (i.e. the one containing the include statement) to be executable (e.g.
chmod +x pagename.html
)
Comments