Enable SSI through cPanel's Handler Configuration

To turn on Server-Side Includes (SSI) for a domain in cPanel, you need to change how the web server handles files that use SSI commands. The most direct route is through cPanel's Apache Handlers tool, which tells the server which file types should process SSI directives before sending them to your browser.

Log into cPanel, find the "Apache Handlers" icon (usually in the "Software" or "Advanced" section), and look for your domain in the list. You'll see file extensions like .html, .shtml, or .php already listed with their handlers. To enable SSI on .html files, you need to add or modify the handler so the server knows to process SSI commands in those files.

The handler you're looking for is typically text/x-server-parsed-html or server-parsed-html, depending on your server setup. If .html files aren't listed, add a new handler with the extension .html and assign it the correct handler type. If .html is already there but assigned to a different handler (like application/x-httpd-php), you'll need to change it.

Key Takeaways

  • SSI is turned on through cPanel's Apache Handlers tool, where you assign file extensions to the server-parsed-html handler.
  • Files must use the correct extension (.shtml or .html, depending on your configuration) for the server to process SSI commands in them.
  • After making changes in Apache Handlers, restart Apache or wait a few minutes for the change to take effect across your domain.
  • If Apache Handlers isn't available in your cPanel, your host may have disabled SSI at the server level, and you'll need to contact support.
  • Test SSI by uploading a file with a simple SSI command like <!--#echo var="DATE_LOCAL" --> and viewing it in your browser.

Where to Find Apache Handlers in cPanel

The location of Apache Handlers varies slightly depending on your cPanel theme and version. In most versions, it appears under the "Software" section or under "Advanced" features. Look for an icon labeled "Apache Handlers" or "Handlers".

Once you open Apache Handlers, you'll see a dropdown menu at the top that lets you select which domain you want to configure. Choose the domain where you want to enable SSI. Below that, you'll see a list of file extensions and their current handlers — this is where you make the change.

Adding or Modifying the Handler for SSI Files

If .shtml files are already listed with the handler text/x-server-parsed-html, SSI is already enabled for that extension. If you want SSI to work on .html files instead (or in addition), you need to either add .html as a new extension or change its existing handler.

To add a new handler: look for an "Add Handler" button or field at the bottom of the list. Enter the extension (for example, html) and the handler type (text/x-server-parsed-html). Click Add or Save.

To modify an existing handler: find the extension in the list, click Edit or the pencil icon next to it, change the handler to text/x-server-parsed-html, and save the change.

After you make the change, Apache needs to reload its configuration. This usually happens automatically within a few minutes, but some hosts let you restart Apache immediately through cPanel's "Restart Services" tool.

Why File Extension Matters for SSI

The web server only processes SSI commands in files whose extension is assigned to a server-parsed handler. This is a security feature — it prevents the server from trying to parse every file as SSI code, which would slow things down and create potential vulnerabilities.

Traditionally, .shtml (parsed HTML) files are used for SSI, while .html files are served as static content. If you enable SSI on .html files, the server will parse every .html file on your domain for SSI commands, even if most of them don't contain any. This adds a small performance cost, which is why many hosts use .shtml as the convention instead.

If you're only using SSI in a few files, consider renaming them to .shtml and leaving .html files as static. If you want SSI to work across all your HTML files, enable it on the .html extension through Apache Handlers.

Testing SSI After You Enable It

After you've set the handler and waited for Apache to reload, create a simple test file to confirm SSI is working. Create a new file called test.html (or test.shtml, depending on which extension you enabled) and add this line to it:

<!--#echo var="DATE_LOCAL" -->

Upload the file to your domain's public_html folder and view it in your browser. If SSI is working, you should see the current date and time displayed on the page. If you see the SSI command itself printed as text, the handler isn't set correctly or Apache hasn't reloaded yet — wait a few more minutes and refresh the page.

What to Do If Apache Handlers Isn't Available

Some hosting providers disable SSI at the server level for security or performance reasons, which means Apache Handlers won't let you enable it even if the tool is visible. If you try to set the handler and it doesn't work, or if Apache Handlers doesn't appear in your cPanel at all, contact your hosting support team.

Ask them directly: "Is SSI (Server-Side Includes) enabled on this server?" If they say no, ask whether they can enable it for your account or domain. Some hosts will turn it on if you request it; others have a blanket policy against it. If your host won't enable SSI, you may need to use a different approach, such as server-side scripting with PHP or a different hosting provider.

Common SSI Commands to Use After Enabling

Once SSI is enabled and working, you can use commands like these in your HTML files:

  • <!--#echo var="DATE_LOCAL" --> — displays the current date and time
  • <!--#include virtual="/header.html" --> — inserts the contents of another file into the page
  • <!--#exec cmd="whoami" --> — runs a system command (often disabled for security)
  • <!--#config timefmt="%A, %B %d, %Y" --> — changes the format of date and time output

The most common use is #include, which lets you insert a header, footer, or navigation menu from a separate file into multiple pages. This saves you from copying the same code into every file.

Frequently Asked Questions

Do I need to restart Apache after enabling SSI?

Apache usually reloads its configuration automatically within a few minutes after you save changes in Apache Handlers. You don't have to manually restart it, but if you want the change to take effect immediately, look for a "Restart Services" option in cPanel and restart Apache from there.

Can I enable SSI on just one folder instead of the whole domain?

Apache Handlers applies to the entire domain, not individual folders. If you want SSI to work only in certain folders, you can use .htaccess files in those folders to override the handler, but this requires more advanced configuration. Contact your host if you need help setting this up.

What's the difference between .html and .shtml files?

There's no technical difference — both are text files with HTML code. The difference is in how the server treats them. By default, .shtml files are parsed for SSI commands, while .html files are not. You can change this by modifying the handler in Apache Handlers, but .shtml is the convention because it signals to you and others that the file contains SSI code.

Will enabling SSI on .html files slow down my website?

Slightly, because the server has to parse every .html file for SSI commands before sending it to the browser, even if most files don't contain any. The performance impact is usually small unless you have thousands of pages. If speed is a concern, use .shtml only for files that actually contain SSI commands.

What if SSI commands aren't working even after I enable the handler?

Check that the file extension matches the handler you set (for example, if you set the handler for .html, make sure your file is named something.html, not something.htm). Also confirm that your SSI syntax is correct — a single typo in the command will cause it to fail silently. Test with the simple DATE_LOCAL command first to rule out syntax errors in your own code.