logo

What are Server Side Includes
What is SSI
Making site navigation easy.

Google
Web Search Hypergurl.com



Handy Tip: Larger web sites must use all web tools available to make site changes in the quickest time possible. Using server side includes, external css files and iframes are just some of the resources available to webmasters to save both time and money.


Bookmark This Page | Click here for more javascripts

Server Side Includes

How many pages does your site hold? 5, 10 or 100? Then you know how hard it is to add a change in your site's navigation or menu structure, and how boring and time consuming making a simple change can be! Here's an easy way using Server Side Includes.

What are Server Side Includes or SSI.

SSI is sort of like using your HTML server as a cut and paste editor. The server reads the document and parses it for directives. Follows the instructions that it finds and merges their results into creating a finished document. The document is then sent to the client browser.

Server Side Includes can help make your pages more responsive and can make maintaining your site an easier task.

Making site navigation easy with the use of Server Side Includes (SSI)

The most common use of Server Side Includes is to edit a large amount of pages, just by editing one file. If you have a large site, using server side includes can make it a simple task to update your pages. I use server side includes in the top, side and bottom menu bars of this page. If I want to add another page to the menu or change a link, then I only have to make a change within the text file and it is done. If you use an editor like Dreamweaver, Frontpage or similar, just open the text file, make the change, save and its done.

By using simple Server Side Includes (SSI) you only need to change one text file and all your pages are automatically updated and that means less work for you.

There are 3 ways that you can achieve the same result, that is to make a change to one file that is reflected throughout your entire site.

In order to use Server Side Includes, your server must be configured to support them. First, check that your server supports them and if you are not allowed to do SSI- consider moving to someplace where you can! But there are ways to still make it possible. Find out how below!

Server Side Includes with .htaccess;

  • Step 1.
    Make sure your host allows the use of an .htaccess file.
  • Make a file called .htaccess using notepad or similar word processor.
  • To the .htaccess file add this code;
    AddType text/x-server-parsed-html .html .htm

  • Step 2.
  • Next, make another text file (you can again use Notepad). The text file can include HTML, javascript, music, whatever you want to show up on a large number of pages. After you've made the text file, save it with the .txt file extension, name it anything you want but it must have the .txt extension.

  • Step 3.
  • Add this code on all your pages where you want the text file to appear . Change the "yourfilename" to reflect what you named the text file.

 

  • Step 4.
  • Upload the .htaccess file, text file and your altered pages to your server.

Server Side Includes using .shtml extension;

If your server does not allow the use of .htaccess then simply make, or change, all your pages from .html to .shtml and use the the example above from step 2.

Another alternative to using SSI

Document - in - Document

Want to add the power of SSI to your site but your web host doesn't support it? Don't want to change all your pages over to .shtml? Then this is for you.

This is a scriplet that allows you to include a document inside another document easily, simply by specifying the URL of the external document inside the scriplet!

By including the scriplet below in multiple pages, a change to the target external document is instantly reflected on ALL of these pages. Unfortunately document to document is only supported by IE4 +. All other browsers will see nothing. Doesn't seem to work in ie 7.0

Take a look at the source code for this page and note that I have used this method on the navigation table at the bottom of the page. If you can't see it then your browser doesn't support this method.

Adjust the width and height to suit and change "yourpage.html" to whatever.

 

 

Hypergurl Hosting
IMPROVED PLANS
FREE Domain Name
web hosting and domain registration

 
Hosting Log In
Username:
Password: Sign up

NEW!

Blog for Webmasters

web site design feed Website Design


 
Refer A Friend
Your Email
Your Name
Friends Email
Friends Name



 



Site design copyright 2001 - 2006 © hypergurl.com