|
1. How do I include the date last modified?
2. How do I include the output of a CGI script?
3. How do I include a file such as a footer on each page?
4. Can I use SSI in webpages that don't end in .html?
5. Where can I find more info on SSI?
6. What is SSI?
1. How do I include the date last modified? - Top
SSI can be used to output the last modification date of the file the
user requested. This is done by using the "echo" element and the LAST_MODIFIED variable. The command would be:
Other variables that can be output in this fashion include DATE_LOCAL (date in the local time zone, EST), DATE_GMT (date in
Greenwich Mean Time), DOCUMENT_NAME (the filename of the document), and DOCUMENT_URI (the URL path of the document).
2. How do I include the output of a CGI script? - Top
Another common use of SSI is to include the output of a CGI script
within your page. The SSI command to do so is: Note :<!--#exec cmd="your.cgi" --> Is not allowed On our servers for security reasons
<!--#exec cgi="your.cgi" --> will fill the requirement For this to work you will have to put the following header
before you begin your html output print "Content-type: text/html\n\n"; If your.cgi does not have any html output, then simply place
the above print statement after the #!/usr/bin/perl declaration
3. How do I include a file such as a footer on each page?
- Top
The most common use for SSI is probably including a file within your
page. This could be used to have a common footer on every page, for instance, while still being able to change it by altering a single
file. Including a file via SSI is done with:
<!--#include virtual="/filename.html" -->
The value of the "virtual" attribute is derived from the URL needed to view the file under your domain name, minus the domain name and
"http://". For instance, if the file to be included is located at http://www.example.com/files/includes/first.txt, your call to include
it in other files under that domain would be:
<!--#include virtual="/files/includes/first.txt" -->
4. Can I use SSI in webpages that don't end in .html?
- Top
In some cases, you may want every .html file to be parsed for SSI.
This can be done with the following command in your .htaccess file:
AddType text/x-server-parsed-html .html
Note: Please do not do this unless you genuinely intend to use SSI in all of your files. The unnecessary overhead of parsing the files
that do not actually use SSI will slow the server down and make your site less responsive (each file will take longer to download as the server must process every file).
Also, don't do this for .shtml files; it will make them stop working! 5. Where can I find more info on SSI? - Top
At Apache's Website.
and at http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html
6. What is SSI? - Top
Server Side Includes - SSI can include information like current date,
the file's last modification date, and the size or last modification of other files.
IMPORTANT : In order for Server Side Includes to work, your file
must be named with the ".shtml" extension. Back to Top
|