httpd.conf must have the mod_include module loaded (so this needs to be copied / compiled if not in there automatically)
LoadModule include_module path/to/apache/mods/mod_include.so
"Include" needs to be added to your options
Options Indexes FollowSymLinks Includes
<IfModule mime_module>
# this section should contain the following:
AddType text/html .shtml .sssi
AddOutputFilter INCLUDES .shtml .sssi
# so any includes named *.sssi will be parsed by apache
</IfModule>
After an apachectl restart, you can make a page called test.shtml which contains this call:
<!--#include file="includes/footer.sssi" -->
And footer.sssi can contain something like this:
<!--#if expr="{$QUERY_STRING} = /printenv/" -->
<div id="debug-footer">
<h3>Debug Footer</h2>
<p>File last modified <!--#flastmod file="$DOCUMENT_NAME" --></p>
<pre><!--#printenv --></pre>
</div>
<!--#else -->
<h3>Standard Footer</h3>
<!--#endif -->
Now when you open test.shtml?printenv you'll see your environment variables.
No comments:
Post a Comment