XSSI

If your server is running Apache Version 1.2 or higher, you can take advantage of XSSI (eXtended Server Side Includes), which provides more advanced command functions (and, consequently, uses code that is a bit more complicated for non-programmer-types.)

This section presents a brief overview of features unique to XSSI. For the nitty-gritty how-to information, see the Apache 1.3 mod_include documentation at http://www.apache.org/docs/mod/mod_include.html. There are several good articles on XSSI available on the WebMonkey site (http://www.webmonkey.com—look for “backend”), which provide good explanations and examples of real-world implementations of XSSI.

Flow Control Elements

Flow control elements are a set of if/else commands (similar to if statements used in a programming language) that allow authors to create conditional commands. Using flow control elements, authors can make documents display differently based on specific variables (the “test conditions”). For instance, you could publish one version of your page for users accessing it with the Netscape browser and another for Internet Explorer users.

The basic flow elements are:

<!--#if expr="test_condition" -->
<!--#elif expr="test_condition" -->
<!--#else -->
<!--#endif -->

The first command contains the if statement that causes the server to test for a condition (e.g., if the browser is Netscape). If it is found to be true, the server prints the text or executes any SSI commands immediately following the if command. If ...

Get Web Design in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.