Updated: 18 October 2026 · Applies to: cPanel and WHM 138 (Jupiter theme), Apache Handlers steps according to cPanel; SSI behaviour tested on Apache 2.4.69 with mod_include
To make .html files run Server Side Includes (SSI) on a cPanel account, add an Apache handler: in cPanel, open Advanced > Apache Handlers, enter server-parsed as the handler and .html as the extension, then click Add. Apache then processes directives such as <!--#include virtual="/includes/header.html" --> in your .html pages. Pages ending in .shtml need nothing: according to cPanel, .shtml is one of the extensions Apache already handles.
1. Add the handler in cPanel
According to cPanel's Apache Handlers documentation:
- Log in to cPanel and go to the Advanced section.
- Click Apache Handlers.
- In the Handler text box, enter
server-parsed(the built-in handler that parses files for server-side includes). - In the Extension(s) text box, enter
.html. For.htmtoo, separate them with a space:.html .htm. - Click Add.
To undo it, click Delete next to the handler in the User Defined Apache Handlers table, then Yes. If Apache Handlers is missing, your hosting provider may have switched it off: according to cPanel, providers can enable or disable it in WHM's Feature Manager. Use the .htaccess line below instead.
2. Or add the handler to .htaccess
Put this line in the .htaccess file of the folder that holds the pages, or in public_html/.htaccess for the whole main site:
AddHandler server-parsed .html
According to cPanel, the default Apache options on a cPanel server (WHM Global Configuration, Directory "/" Options) include IncludesNOEXEC, which allows includes but not #exec. With that option set in our lab (Apache 2.4.69 in a test container, not a cPanel server), this one line was enough: the page came back with its header and footer included.
If your server needs an Options line as well, use Options +IncludesNOEXEC. In the lab, Options +Includes also let <!--#exec cmd="id" --> run a command on the server as the web server user. To edit the file, see How to Edit .htaccess File via the cPanel File manager?
3. Write the include directive
- Start with
<!--#and no space. In the lab,<!-- #include ... -->and a directive without the#both stayed plain HTML comments. - Write the command in lower case with the value in double quotes. According to Apache, single quotes also work. Upper case and unquoted values worked in the lab, but stick to the documented form.
- Leave a space before
-->. According to Apache, this makes sure the end of the comment is not read as part of the directive.
There are two ways to name the file:
<!--#include virtual="/includes/header.html" -->takes a URL path. A leading/starts at the document root of the domain serving the page:/home/alice/public_htmlfor the main domain of the accountalice, or the addon domain's own folder. In the lab, the same line on an addon domain included that domain'sincludes/footer.html, not the main site's. Without the leading/, the path is relative to the current page. Apache recommendsvirtualoverfile.<!--#include file="menu.html" -->takes a path relative to the page's folder: the same folder or one below it. Paths with../or a leading/are refused.
4. Check that it works
- Open the page and view its source in the browser. If you still see
<!--#include ... -->, the file was not parsed: check the extension in the handler and that the.htaccessline is in the right folder. - If the page shows [an error occurred while processing this directive], SSI is working but the include failed. Open Metrics > Errors in cPanel, which according to cPanel shows the latest Apache error log entries for your domains. Lab examples (date, process and client details removed):
[include:error] (20023)The given path was above the root path: unable to include file "../includes/footer.html" in parsed file /home/alice/public_html/blog/bad.html [include:error] unable to include "/includes/missing.html" in parsed file /home/alice/public_html/blog/bad.html, subrequest returned 404
With the handler, Apache reads every .html page for directives, even pages without any. If only a few pages need includes, naming just those pages .shtml avoids that work.
Related articles
- What Are Server Side Includes (SSI) and When to Use Them
- Do you support SSI (server side include) on html pages?
- How to Enable Server Side Includes (SSI) in HTML Files covers SSI on your own Apache or nginx server.
Official documentation: cPanel Apache Handlers and Apache mod_include.