SSI - Server Side Includes

To include HTML (or other extension) files into another HTML file,

<!--#include VIRTUAL="/filetoinclude.html" --> is the line to use.

VIRTUAL is used when file path is not local, such as when "/" is used. Otherwise, it can be replaced by FILE="filetoinclude.html".

For this to work, SSI on web server must be enabled. Most servers such as Apache CPanel default this to shtml. So, to have the Apache CPanel use html extension as the host file as well, add handler: server-parsed and extension: .html

Included files can have any extension, supposedly.

If the host file is php, then maybe it's better to use <?php include("../leftmenu.html"); ?>
The path "../" or full path "http://...." seems necessary, because merely "/leftmenu.html" would not work.

This entry was posted in Technical. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

ERROR: si-captcha.php plugin: GD image support not detected in PHP!

Contact your web host and ask them to enable GD image support for PHP.

ERROR: si-captcha.php plugin: imagepng function not detected in PHP!

Contact your web host and ask them to enable imagepng for PHP.

This site uses Akismet to reduce spam. Learn how your comment data is processed.