Re: What is SHTML? How to Implement SHTML and its uses? SHTML
SHTML is HTML that is basically processed on the server prior to it being served in the browser. You can use it to include files to help you wiht easy changes.
For example, you can create a nav.html file to be included into an SHTML file. And then, when you add a new page, instead of changing ten pages, you only need to change one page. And then your nav will be updated on all pages. As far as building a site with SHTML - it is still HTML, but it is parsed on the server.
.shtml extensions.
* Server Side Includes and Performance Considerations: Why the .shtml extension is used
If an html document contains "Server Side Includes" that means that it includes special commands for the Server to process. This is normally how things like counters are done on basic web pages.
On some websites, the webmaster sets up the server to parse, or read through every .html or .htm file to see if it contains server instructions. However, this WILL slow things down when people link to the pages.
So, many webmasters have instituted the .shtml files. This is simply a naming convention that says "This html file includes Server commands - please parse it before delivering to the browser site" (hence the "s"). That way parsing can be skipped for all "plain" .html [or .htm] files.
* Alternatives to the .shtml extension
It doesn't have to have "shtml" - that's just the most commonly-used convention. But if it's used, it's used because your webmaster decided that that was the one they would pick. And if they did pick it, they may or may not have set up your server so that it would look for a default file of EITHER "index.shtml" or "index.html" (Some servers, as mentioned, can't have more than one file name as a default, and some webmasters don't think of doing this, which can complicate your Welcome page if you want to use server-side includes). Some other names you may see are .phtml (for Parsed HTML) and even .chtml (for Command HTML). Again, it's up to the webmaster, but .shtml is pretty standard these days. Microsoft's Internet Information Server (IIS) uses .ssi as a three character extension for .shtml file.
* Two More Server-Related File Extensions: .cgi and .asp
CGI stands for Common Gateway Interface. CGI files cause events to happen on the Server, normally through executing programs written in PERL, C, C++, or other programming languages. This is often used for things like database access, creation of customized HTML files, forms processing, and so on. Many CGI files use a .cgi extension, which can be set up to tell the Server that special handling or permissions are required for the file. You will not normally have a .cgi file as your default file in a directory, but if you do, you may run into the same kinds of issues as you do with .shtml files.
With the introduction of ActiveX, Microsoft has also introduced a new kind of server side file, Active Server Pages. These pages provide Server side ActiveX processing. These can perform many of the same functions as .cgi scripts, but are integrated into the ActiveX environment for Servers like IIS which support ActiveX. These files use the extension .asp. On some sites, again, depending on what the webmaster wants to do, HTML files which are generated from ActiveX scripts, or even HTML files which simply call ActiveX scripts, may also use the .asp extension. As with CGI, this becomes particularly important to you when you want to use a .asp file as the default file in your directory, and you may have to discuss the issue with your Webmaster.
Thanks Sathian.K |