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

What are some tools are available to optimize my website?

Website Tools & SEO | Updated March 2026 Here are the best free tools for testing and...

How to Pass Variables Between HTML Pages

General | Updated March 2026 Plain HTML files cannot pass variables between pages on their...

Why Can I Not Ping My Domain

General | Updated March 2026 If the ping command does not respond when you ping your domain,...

Enable AllowOverride

General | Updated 2026 If your .htaccess rules are being ignored (redirects not working,...

Default Nameservers

DNS | Updated 2026 When you register a domain or transfer your hosting to Ultra Web Hosting,...



Save 30% on web hosting - Use coupon code Hosting30