Well I wonted to try out some file(.shtml) with #include statment on my machine and It is not working.I'm asking u if I need a server (like Apache) to run this script and if server (Apache) needs some plug-in or add-on (or whatever) to serve this kind of scripts?? :confused:

Dani AI

Generated

As noted, Server Side Includes (SSI) are handled by the web server before the page is sent to the browser. That means an .shtml file opened from the filesystem (file://) will not run SSI — the page must be requested over HTTP from a server that is configured to parse SSI. ’s local test therefore needs a running web server (Apache, IIS, etc.) with SSI enabled.

A minimal Apache setup that parses .shtml files looks like this (place in the main config or a .htaccess if allowed):

Options +Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Alternatively AddHandler server-parsed .shtml can be used. The include directive itself is written as an HTML comment (for example, <!--#include virtual="/inc/header.html" -->) so if that comment appears verbatim in the browser source the server is not parsing SSI.

Troubleshooting checklist: confirm mod_include is loaded (look for LoadModule include_module or use a2enmod include on Debian/Ubuntu), ensure the directory has Options +Includes, restart Apache after changes, check AllowOverride if using .htaccess, and review the server error_log for SSI-related messages. For local Windows installs check httpd.conf for the module line and restart Apache.

If the goal is to reuse JavaScript across pages, linking to an external .js with <script src="..."> is generally better (caching, MIME handling) than inlining via SSI unless server-side composition is required. For implementation details see the Apache SSI HowTo and mod_include documentation: https://httpd.apache.org/docs/current/howto/ssi.html and https://httpd.apache.org/docs/current/mod/mod_include.html.

normally SSI needs to be enabled on the server for it to work. I have had a lot more exp with IIS than I have with Apache when doing includes, but I would do a serach I am sure it is probably just an add on.

Cool, I'll look and get back with exp.
Tnx!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.