[ What is SSI?
| How do I do SSI?
| Examples]
[ When should I use JavaScript instead?
[ Transition issues
| More help? ]
SSI lets you embed a number of special 'commands' into the HTML itself. When the server reads an SSI document, it looks for these commands and performs the necessary action. For example, there is an SSI command which includes one file within another file.
Shamash has enabled Server Side Includes, but disabled for security reasons the the #exec command and #include of CGI scripts. At the current time we are not using XSSI.
SSI has been around for a very, very long time in the history of the world wide web. Thus, almost all browsers support it, unless they are truely antique. All the 'work' of SSI is done on the shamash server, not the client browser.
How do I use SSI?
To have a web page parsed by Server Side includes (SSI), it needs to end in .shtml instead of .html or .htm.
You then need to include some special SSI commands in your HTML. There are SSI commands which get the size of a file or URL, the contents of a variable (passed in by the server), the contents of another file or URL. Bascially, for each SSI command you need to have the format:
where arg1, arg2, etc are the names of the arguments and value1, value2 etc are the values of those arguments. Please also note that all SSI commands go within an <!--HTML comment --><!--#command arg1="value1 arg2="value2 ... -->
<table border> <tr> <td width="25%"> <!-- This is a menu of options for our site --> <!--#include file="menu.html" --> </td> <td><!-- The body goes here --> This is the body of the web page here </td> </tr> </table>The output looks like this:
![]()
Shamash Home PageThis is the body of the web page here
If this problem persists, contact <a href="mailto:webmaster@domain.xxx">webmaster@domain.xxx</a>. When emailing us, please copy the following few lines of text into your email: <tt> <br> <b>URL:</b> http://<!--#echo var="HTTP_HOST" var="REQUEST_URI"--> <br> <b>Web Browser:</b> <!--#echo var="HTTP_USER_AGENT"--> <br> <b>Remote Host:</b> <!--#echo var="REMOTE_HOST" var="REMOTE_IDENT"--> <br> <b>Date/Time:</b> <!--#echo var="DATE_LOCAL"--> <br> <b>Refering Page:</b> <!--#echo var="HTTP_REFERER"--> </tt>The output looks like this:
If this problem persists, contact webmaster@domain.xxx. When emailing us, please copy the following few lines of text into your email:
URL: http://www.shamash.org/help/ssi.shtml
Web Browser: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
Remote Host: (none)(none)
Date/Time: Saturday, 21-Nov-2009 03:37:25 EST
Refering Page: (none)
<br> <SCRIPT LANGUAGE="JavaScript"> <!-- hide from non-JavaScript browsers document.write("Last updated: "+document.lastModified); // end hiding --> </SCRIPT> <br>The output looks like:
Be sure to redirect your old .html pages to .shtml pages during your upgrade. This is especially important if people enter your site through a variety of different ways, some may go to http://shamash.org/YOURLOGIN/ while others may go to http://shamash.o
rg/YOURLOGIN/index.html or http://shamash.org/YOURLOGIN/anotherpage.html. Thus, for each .html page you get rid of, and create a .shtml page, you should direct the user from the old .html page to the new .shtml page. A good way to do this, is explained
in the Shamash Webmaster's
FAQ. Basically, you'll need to create a short .html page that points people to the .shtml page.
Where can I get more help?
Technical documentation about SSI can be found at:
This page has been viewed
times since January 1, 1998.
Web Author: webmaster@shamash.org
|
![]() Tax Deductible |
[ Search
| Help ]
|