I’m interested in using SSIs on my website, and I’m wondering which servers support this. I know this is a dumb question, but I’m a dumb person, so speak slowly and use little words, please. I could also use some help in general on these things, like a pointed finger towards a good (free) program that lets me test these dinguses on my home computer. I’ve heard of these sorts of things, but the cave I live in has a 26.6 kbps connection, and I have mammoths to slay. I also need to know about any bad side-effects of using SSIs, like nausea, or a slow-down in the speed of site navigation.
Now, if you don’t mind, I have an electrical socket to stick my mom’s car keys into, and a pot of coffee to burn holes in my stomach with…
Different servers do SSIs differently. Microsoft IIS, for example, requires all pages involved in an SSI (parent and child) to be .asp, whereas an Apache server uses .shtml for file extentions.
Of course, being Microsoft/Linux based, the scripting for SSIs are different in each server, but both are similar:
<!–#include virtual=“filename.shtml” --> is how you do it on Apache. I don’t have the IIS code handy, but I think it’s: <!–#include file=“filename.asp” --> (be sure to doublecheck that).
Apache is the only web server that I have experience using, but it’s relatively simple to set up. All you have to do is uncomment the appropriate lines in the configuration files. You can have it automatically parse all files, or only files with extensions you specify (does not necessarily have to be .shtml).
Once that’s done, the general format is <?–#COMMAND ARG=VALUE–> where COMMAND is the command you want to use, ARG is the argument appropriate to that command, and VALUE is what you want the command to take action on.
Examples:
<!–#echo var=LAST_MODIFIED–>
<!–#exec cgi=“http://localhost/cgi-bin/program.cgi”–>
<!–#exec cmd="/sbin/ifconfig eth0"–>
<!–#include …/header.html"–>
As far as being able to test on your own computer, the only solution I’m aware of would be to install a web server on your computer. There may be small cheap packages that incorporate SSI, but I don’t know any. Apache is a big download, but it is free.
I have Sambar server 4.4 installed locally. It’s free, and a 4.3mb download. Right now, as I checked that URL, I found a beta for version 5.0 that I’m downloading.
Sambar, I know, accepts Apache SSLs, and it might also process IIS ones, too, I’ve never tried.
Thanks for the help, I think I understand this now. All I’m interested in is just having it to where I can store common parts of a page as seperate HTML files, and including them in documents so I don’t have to run through with Notepad at 3 AM after realizing my goofs. Thanks, guys. Now, if only I could figure out this ‘put one foot in front of the other when walking’ bit…
This afternoon, while toiling around on CNet’s Builder.com looking for information about using javascript to create links for adding a favorite in IE, I found this page, about SSIs.