Make Site Updates Simple with SSI: Server Side Includes

But the thought of modifying each and every one of your pages is overwhelming - if only there were a better way. There is...a much better way. In fact...

provided by: 


By Peter Prestipino

You have a website that needs updating. But the thought of modifying each and every one of your pages is overwhelming - if only there were a better way. There is...a much better way. In fact, it will make your Web life so much easier you will kick yourself in the virtual pants for not thinking of it sooner or implementing it when you started.

Webmasters and website owners the 'Net over use server side includes (SSI) to reduce the time spent updating and tweaking websites. While it may not be the answer to all of the complex navigation problems of existing sites, establishing SSI at the onset of design will pay off when the inevitable redesign comes or when you need to add something special quickly.

What is SSI and how does it work?
SSI are like puzzle pieces, in that individual pieces (documents) are assembled together to create a final product (your web page). When a Web page is opened, a server looks at the document's file extension to determine whether it is a static document, in which case it can be sent straight to the browser without modification, (e.g., .htm or .html) or a dynamic document that contains SSI commands, requiring additional processing (.shtml). A document with the .shtml extension informs the server that SSI tags are included. Once an SSI tag is found, the server will attempt to run the command and insert the results of each command into one document - the page being viewed by the visitor.

Instead of changing pages one-by-one by pasting revised code over outdated code, SSI enables Web designers to make one change in one place. Take, for example, that your website contains 100 Web pages, and along comes a company sales executive requesting a link to a new white paper on every single page of the site. Without SSI you would have to spend hours making the addition to each individual page. With SSI, however, a quick change to one file adds the white paper to every page on your site and the sales executive is off and running.

There are other benefits to SSI files related to page loading speed. Since one line of SSI code replaces what might have been several in an HTML file, files are smaller and take less space on a server. Since the include file has already been loaded with the first page a visitor sees, the next page is much faster to load.

Getting Started With SSI
To utilize SSI, your server must be configured properly. There is a different setup procedure for both Internet Information Services (IIS) and Apache (and some easy tweaks with Apache) so ask your Web host if the procedure has already been established. Also, ask if it has been set up to parse .html extensions to read SSI correctly. The next step is the actual implementation of SSI on the web page(s) itself.

Suppose you want to replace the code which displays a navigation menu on all pages of your website. Create a separate Web page consisting of only the code for the navigation menu (it is not necessary to have Head, Title or Body Tags - just the text and code of the navigation menu itself), save it as an HTML file and upload it to the appropriate directory.

Then, replace your existing navigation menu with the following code on each page where the old navigation code appeared. For your site, substitute "nav1.html", with the separate menu file name of your choice - something appropriate and easy to remember.

<!--#include virtual="nav1.html" -->

Inserting this simple line of code will tell the browser to request the SSI file. When the browser opens the website, the SSI file is retrieved and replaces the old files. Now, whenever the SSI file is modified, the changes will appear on each page containing the new code (as seen above). The end result is the ability to make one change to one file and have it reflected
throughout the site.

If you have placed the navigation include file in a separate directory (take for instance http://yourdomain/navigation/) this would be the line to place in your code:

<!--#include virtual="navigation/nav1.html" -->

Improving Server Side Includes
SSI is a powerful tool that puts the power of refined layout in the hands of designers. There are instances, however, when you do not need or want to put everything into a single SSI file. Say for example you would like one navigation menu for some pages but a different navigation menu for others. When this is the case, creating two SSI include files is the best choice.

You can also use an SSI include file to hide some of your source code. For example, if you are running a proprietary or a third party script, using an SSI will hide the code from prying eyes and speed up loading time.

What about SSI and SEO?
Search engine spiders get what the browser gets - a complete page. How the page was made is inconsequential. Whether static or dynamic, it's just an HTML page.

Search engine spiders read SSI files in the same way that a browser for human visitors does - they do not "know" that it is SSI. They "believe" that it is simply part of the page. SSI includes are processed by the server while outputting the page in response to the client request. As long as the SSI code contains no errors, the page content created by SSI is no different than any of the other content on the page. Therefore, the underlying SSI code is invisible to spiders as it is to human site visitors.

SSI includes can save you from the time and aggravation of making multiple changes to your site. Plus, they reduce the file size and increase loading speed. Try it out. You'll see that, over time, SSI will drastically cut down on your Web maintenance time and give you more time to be frustrated over other aspects of your site. â– 




Read full article at websitemagazine.com
Regional Articles
- Make Site Updates Simple with SSI: Server Side Includes Alabama
- Make Site Updates Simple with SSI: Server Side Includes Alaska
- Make Site Updates Simple with SSI: Server Side Includes Arizona
- Make Site Updates Simple with SSI: Server Side Includes Arkansas
- Make Site Updates Simple with SSI: Server Side Includes California
- Make Site Updates Simple with SSI: Server Side Includes Colorado
- Make Site Updates Simple with SSI: Server Side Includes Connecticut
- Make Site Updates Simple with SSI: Server Side Includes DC
- Make Site Updates Simple with SSI: Server Side Includes Delaware
- Make Site Updates Simple with SSI: Server Side Includes Florida
- Make Site Updates Simple with SSI: Server Side Includes Georgia
- Make Site Updates Simple with SSI: Server Side Includes Hawaii
- Make Site Updates Simple with SSI: Server Side Includes Idaho
- Make Site Updates Simple with SSI: Server Side Includes Illinois
- Make Site Updates Simple with SSI: Server Side Includes Indiana
- Make Site Updates Simple with SSI: Server Side Includes Iowa
- Make Site Updates Simple with SSI: Server Side Includes Kansas
- Make Site Updates Simple with SSI: Server Side Includes Kentucky
- Make Site Updates Simple with SSI: Server Side Includes Louisiana
- Make Site Updates Simple with SSI: Server Side Includes Maine
- Make Site Updates Simple with SSI: Server Side Includes Maryland
- Make Site Updates Simple with SSI: Server Side Includes Massachusetts
- Make Site Updates Simple with SSI: Server Side Includes Michigan
- Make Site Updates Simple with SSI: Server Side Includes Minnesota
- Make Site Updates Simple with SSI: Server Side Includes Mississippi
- Make Site Updates Simple with SSI: Server Side Includes Missouri
- Make Site Updates Simple with SSI: Server Side Includes Montana
- Make Site Updates Simple with SSI: Server Side Includes Nebraska
- Make Site Updates Simple with SSI: Server Side Includes Nevada
- Make Site Updates Simple with SSI: Server Side Includes New Hampshire
- Make Site Updates Simple with SSI: Server Side Includes New Jersey
- Make Site Updates Simple with SSI: Server Side Includes New Mexico
- Make Site Updates Simple with SSI: Server Side Includes New York
- Make Site Updates Simple with SSI: Server Side Includes North Carolina
- Make Site Updates Simple with SSI: Server Side Includes North Dakota
- Make Site Updates Simple with SSI: Server Side Includes Ohio
- Make Site Updates Simple with SSI: Server Side Includes Oklahoma
- Make Site Updates Simple with SSI: Server Side Includes Oregon
- Make Site Updates Simple with SSI: Server Side Includes Pennsylvania
- Make Site Updates Simple with SSI: Server Side Includes Rhode Island
- Make Site Updates Simple with SSI: Server Side Includes South Carolina
- Make Site Updates Simple with SSI: Server Side Includes South Dakota
- Make Site Updates Simple with SSI: Server Side Includes Tennessee
- Make Site Updates Simple with SSI: Server Side Includes Texas
- Make Site Updates Simple with SSI: Server Side Includes Utah
- Make Site Updates Simple with SSI: Server Side Includes Vermont
- Make Site Updates Simple with SSI: Server Side Includes Virginia
- Make Site Updates Simple with SSI: Server Side Includes Washington
- Make Site Updates Simple with SSI: Server Side Includes West Virginia
- Make Site Updates Simple with SSI: Server Side Includes Wisconsin
- Make Site Updates Simple with SSI: Server Side Includes Wyoming
Rate Article
     
Articles Insider

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Advertising Educational Content Home Appliances Real Estate Resources
Business Services Entertainment Home Electronics Software
Career Family Home Services Technology
Cars Fashion Internet Telecommunications
Chamber of Commerce Financial Services Legal Trade Shows
Computer Hardware Franchise Miscellaneous Travel
Construction Health Nightlife Weddings
Education Holidays Online Database World History