Compare Web Hosting Plans Comparison shopping for a
great web hosting deal!
Home - Budget Hosting - Virtual HostingDedicated ServersReseller Plans - Free Downloads - Articles
 

 

How to use Server Side Includes (SSI)



Server Side Includes (SSI) make it easy to make site-wide changes to your website in minutes, even if you need to update 1,000 pages or more! Need to add a new navigation link to the menu on every page?

With SSI, this is very easy to do. All you have to do is change one file and the menu is instantly and automatically updated on every page!

SSI works by pulling information (HTML code, text, links, photo's, etc.) from a single file and inserting it automatically on any page with the include code on it.

Steps for using SSI on your website:
  1. Create a standard web page that contains just the information that you want inserted on the other pages. Give the page a name that reflects the type of information in the file. For our menu example, we could name the file menu.html.
     
  2. On every page, we would place the following code where we want the menu to appear:
     
      < !--#include virtual="menu.html"-->
       
    This code instructs the server to take the information that is in the menu.html file and insert it into the current page at the location designated by the include statement.
     
  3. For every page that will use the include, change the .html file extension to .shtml. This lets the server know that the page uses SSI.
     
      example:  index.html becomes index.shtml
       
  4. Upload the menu.html file and each page that will use the SSI to the server. Now when those pages are loaded, they'll display the menu contained in the menu.html file at the exact location on the page where you placed the include statement.
SSI can be used to make site-wide updates for virtually any part of your web pages. I use it to display my menus, headers, footers, and more. On my 1000+ page Directory site, I use SSI to display a "tip of the day" on each and every page of the site. To change the daily tip on all 1000+ pages, all I have to do is change the tip.html file!

 
Home  -    -  Add URL  -  Site Map
© 2003-2006 CompareHosts.com