views:

59

answers:

2

I'm new to creating html pages etc - but am using VS 2008 just for the editing/intellisense capabilities.

My problem is I have a pure HTML only website (no ASP.NET) and have a fairly extensive header that has to be used in every page. It's frustrating to change the header parts of the HTML across all pages every single time it changes in one. Is there someway I can sort of 'include' the header part HTML in other HTML pages without having to manually cut-paste all-over?

Please note - I'm not using ASP.NET, so I CANNOT and WILL NOT be able to use Master Pages. Is there some other technique is what I want to know - so that when I change the header template in 1 place, it gets reflected in all other. I thought of inline frames, but not sure if that's a crappy way to do that and if it affects SEO

+1  A: 

Take a look at Server Side Includes

They'll allow you to edit your header in the one file, which will appear instantly on all pages that include the header file.

Lazlow
+1 SSI is an often overlooked, but still really useful and widely available technology.
Michael Stum
On XP Pro - ensure Server Side Includes was installed alongside IIS (Add/Remove Windows Components > Application Server > IIS > Server Side Includes). If it is, the virtual include should work - does it error, or just not include it (i.e. visible when viewing source)?
Lazlow
+1  A: 

Yes, take a look at SSI. Server side includes are a simple way to tell your web server to insert various things at various points in your HTML page.

Example:

<html>
<head>
    <!--#include FILE="head.html" -->   
</head>
<body>

</body>
</html>

If server side includes don't appear to work as expected, try renaming the page with a .shtml file extension.

Some web servers require that you name your file ".shtml" rather than ".html" in order to enable the parsing of your file.

Tommy