html or htm parsed as shtml not working

General | Updated 2026

If you have configured your server to parse .html or .htm files as Server Side Includes (SSI/SHTML) and it is not working, this guide covers the correct setup and common fixes for Ultra Web Hosting accounts.

Quick Fix

Add this line to your .htaccess file to parse .html and .htm files for Server Side Includes:

AddHandler server-parsed .html .htm

If that does not work, try the alternative directive:

AddType text/html .shtml
AddHandler server-parsed .shtml .html .htm

01. What is SSI/SHTML

Server Side Includes (SSI) is a simple server-side scripting language that lets you include common elements (headers, footers, navigation) across multiple HTML pages. Files with the .shtml extension are parsed for SSI directives by default. Regular .html files are not parsed unless you explicitly enable it.

Common SSI directives:

<!--#include virtual="/header.html" -->
<!--#echo var="DATE_LOCAL" -->
<!--#exec cmd="date" -->

02. How to Enable SSI for HTML Files

Create or edit the .htaccess file in your document root (public_html/) and add:

AddHandler server-parsed .html .htm

This tells Apache to scan .html and .htm files for SSI directives before serving them to the browser.

Performance Impact

Enabling SSI parsing for all HTML files means Apache must process every HTML page through the SSI parser, even pages that do not use any SSI directives. On high-traffic sites, this adds unnecessary overhead. Consider using .shtml extensions only on pages that need SSI, or switch to PHP includes instead.

03. Troubleshooting

  • SSI directives show as HTML comments - the handler is not active. Check that your .htaccess file is saved correctly and does not have a different extension. See htaccess file disappearing
  • 500 Internal Server Error - the SSI directive has a syntax error. Check for typos in the <!--#include syntax. Every directive must start with <!--# and end with -->
  • Included file not found - the virtual path is relative to the document root, not the current directory. Use /path/from/docroot/file.html
  • exec directive not working - exec cmd may be disabled on shared hosting for security. Use include virtual with a PHP or CGI script instead

For more .htaccess configuration, see Complete Guide to .htaccess on Apache.

04. Modern Alternatives

SSI was popular in the 1990s but has largely been replaced by better options:

  • PHP includes - rename your files to .php and use <?php include('header.php'); ?>. More flexible and widely supported. See How to Parse HTML as PHP
  • WordPress or a CMS - handles headers, footers, and templates automatically
  • Static site generators - tools like Hugo, Jekyll, or 11ty build complete HTML from templates

Need Help With Your Website?

If you are having trouble with SSI or need help modernizing your site, our team can assist.

Open a Support Ticket

Quick Recap: SSI/SHTML Setup

  1. Add AddHandler server-parsed .html .htm to .htaccess
  2. Use correct syntax for includes: <!--#include virtual="/path" -->
  3. Check paths are relative to document root, not current directory
  4. Consider PHP includes as a more flexible modern alternative
  5. Use .shtml extension only on pages that need SSI to avoid performance overhead

4,530 users found this article useful · Last updated March 2026 · Browse all General articles

  • 134 Users Found This Useful

Was this answer helpful?

Related Articles

How to Speed Up Your Website

Website Tools & SEO | Updated March 2026 A slow website loses visitors and hurts search...

When should I use ascii and when should I use binary?

FTP | Updated 2026 This Article Has Moved ASCII mode converts line endings for text files...

Adding HTML to Site Builder

Obsolete Feature | 2026 This Feature Has Been Retired The legacy cPanel Site Builder has...

How do I cancel my account?

General | Updated 2026 If you need to cancel your hosting account with Ultra Web Hosting, you...

Can you write a script for me?

Article Updated This article has been consolidated Custom script requests are addressed...



Save 30% on web hosting - Use coupon code Hosting30