Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come my HTML Include wont work?

Tags:

html

include

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?

like image 371
Chris Bier Avatar asked Feb 12 '26 03:02

Chris Bier


2 Answers

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.

like image 105
Chuck Avatar answered Feb 21 '26 02:02

Chuck


  • Make sure the (including) file has a .shtml extension
  • Make sure server-side includes are enabled in the web server
like image 38
Rob Avatar answered Feb 21 '26 02:02

Rob