dindorp.info

Utility Link | Utility Link | Utility Link

Server Side HTML


What the Heck is Server Side HTML?

by: Robert Plank

If you're stuck in the dark ages and are still editing the pages of your web site by hand, there's an easy way to change the look of your web site on a moment's notice, by editing only one file.

I know, there are all kinds of brand new blogging scripts, forums, CMSes, and other stuff to make your site easy to update. But on the other hand there are just as many desktop-based programs that churn out thousands of static HTML files for you to put on your server.

What do you do when you have to change these files later? Edit them by hand, one at a time? I don't think so.

You can save a lot of time down the road using Server Side Includes (SSI).

The point of using Server Side HTML is so you can include other pages on your regular HTML pages, things like a list of links you regularly update OR a header and footer.

Try it out. Take one of those static HTML pages on your site and rename it to something like "filename.shtml" instead of "filename.html." All we've done is changed the "html" at the end to "shtml."

Now, take the part of that site you want to appear on every page (the header graphic, link sidebar, etc.), copy and paste that part and save it into a file named "header.shtml." REMOVE that text from your filename.shtml file.

Now, in the filename.shtml file, place this at the top:

[!--#include virtual="/header.shtml"--]

(IMPORTANT: Replace the brackets [ and ] above with the greater-than and less-than "HTML" brackets... hold shift and press the "comma" and "period" keys on your keyboard.)

Upload filename.shtml and header.shtml to your server and load header.shtml. If everything went well, the page should look exactly as it did before. The only difference is: you only need that one "include virtual" line to show the top of the page, AND to change that top HTML later on all you have to do is edit header.shtml.

If you had this sort of code on 20,000 pages of your web site all you'd have to do was edit that ONE header.shtml file, and your entire site would change as soon as you uploaded that header.shtml file.

Not bad, huh?

Now do the same thing with the bottom of your web site, only save the new file as footer.shtml and at the bottom of filename.shtml place this:

[!--#include virtual="/header.shtml"--]

Again, not that exact code... replace the hard-brackets with HTML brackets.

But wait, your fancy page generator software will only save the files as .HTM or .HTML, and specifically links to certain files. You can't just go in and edit everything to link to .SHTML files.

Htaccess to the rescue.

Place this in a new text file:

AddHandler server-parsed .shtml .html .htm

Save that as "htaccess.txt", upload to your web server, and rename that htaccess.txt file you just uploaded to ".htaccess", WITH the dot in front. Now try renaming filename.shtml to filename.html. Guess what, your server side includes now work on .html and .htm files too.

Hopefully your page generator software allows you to edit the template and place these server-side include tags in there. (If not, look into a program called BKReplaceEm.) Don't worry, the pages will look funny and broken on your hard drive but once they are sitting on your web server everything will turn out ok.

If you find yourself doing a bunch of repetitive HTML editing it might be time to look into Server Side Includes to make instant changes.


About The Author
Robert Plank
You know what else, you can use a similar bit of HTACCESS code to make PHP scripts act as HTML files.
That, plus 35 more "Why Didn't I Think of Those" secrets are revealed in my upcoming ebook

 


 

Welcome to dindorp.info
and the 3-way exchange directory.

This site is part of a 'family-of-sites' and exists for the purpose of distributing information and articles to webmasters, in addition to forming part of a three way exchange network.

The dindorp.info site will provide return links to your site if you have put up links for one of my major sites.

What we are talking about here is best described as reciprocal linking at arms lenght.

This is done in order to avoid immediate reciprocality in the eyes of major search engines - and consequently help us both achieve better ranking on same.
For this to work best, you are advised to make your requested link fairly verbose, - in other words - not just a brief line of text - as most sites would want you to, but rather a short 'story' outlining the content and purpose of your site.
This will help make up the site content here and the relevancy of the link to your site.
The examples below should - hopefully - illustrate the point I'm trying to make.

Story Title

 

dindorp.com I am dedicating this site to promoting webmaster resources of various kinds:
Articles for free reprint or web use, a nice Colour Picker, RSS news Channels on computing and technology and more.

It is planned that syndication of articles will be promoted from the site, so if you are into writing articles for free distribution, let me know, so that I can help spread the word for you . .

read more . .

www.bath4.com This is a very pretty site dealing with the attractions and amenities of the Roman Baths and Georgian Spa city of Bath in Somerset, Uk.
(A World Heritage Site)
It contains many helpful and informal sections with listings of popular lodgings and restaurants in and around Bath,
Easily find local taxi services, lodgings and other travel information.
A variety of authors have contributed stories about Bath itself and many other subjects.

read more . .

www.dindorp.co.uk My first site. Currently being reworked, as many of it's functions are now being served by radstock4u.com and somerset4u.com. It still scores very well on most of it's keywords, so change will be slow and very gradual in order to keep this going, allthough - in the short term it may appear a little unsure about the direction in which it is going . .



read more . .

www.radstock4u.com Dealing specifically with the ex mining and railway town of Radstock in north east Somerset, Uk .
This site tries to deal with local issues and information for locals, whilst at the same time providing tourist info and hotel and restaurants guides for those who may be considering a visit for whatever reason . .
Contains our delicious recipe collection and much of general interest.

read more . .

www.worldofhospitality4u.com - a site built over a massive data base of tourist and general hospitality related info.
You'll find an abundance of travel articles about interesting and far away places.
Good for looking up information about places you fancy visiting, or just to while away some time dreaming about where you would rather be right now . .


read more . .

www.somerset4u.com This site attempts to provide general and tourist specific info about all of Somerset, UK.
You'll find copies of selected news releases by some of the local councils, interwoven with directories of Somerset related websites, a Somerset Classified directory, histories of Somerset Towns and some of the Somerset canals.
- should do well once locals start contributing more area specific content .

read more . .

Seychelles Dreams | Fiji Islands Fishing | Bahamas Adventure | Madeira - garden island of the atlantic | Island Links

| dvd, music & movie review | home & garden tips |

 

About Us | Site Map | Privacy Policy | Contact Us | ©2005 dindorp.com