Chris Bier
Chris Bier

Reputation: 14447

How come my HTML Include wont work?

I am making a site right now and I want to include the sidebar in every page. I have looked everywhere and everyone says to use the following code:

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

I have done this but to no avail. I am using dreamweaver for easier uploading and managing of my files, and it shows up in dreamweaver. I would just use PHP but I dont want all of my pages to be PHP for just one code that can work in HTML..

Any ideas?

Upvotes: 2

Views: 1067

Answers (3)

Sorskoot
Sorskoot

Reputation: 10310

This page has a lot of info on Server and Client side includes. It shows a couple of alternatives to the #include also.

Start by trying to rename the .html file to .shtml. Also, make sure server side includes are enabled on your server.

Upvotes: 2

Chuck
Chuck

Reputation: 237060

That isn't an "HTML" feature. It's Server-Side Includes. You need to make sure you have SSI active on your server and that it's set to apply to the file.

Upvotes: 6

Rob
Rob

Reputation: 48369

  • Make sure the (including) file has a .shtml extension
  • Make sure server-side includes are enabled in the web server

Upvotes: 4

Related Questions