How do I parse html files as shtml?

General | Updated 2026

Server Side Includes (SSI) let you include content from one file into another using directives like <!--#include virtual="/header.html" -->. By default, only files with .shtml extensions are parsed for SSI directives. Here is how to make .html or .htm files support SSI too.

Add to .htaccess

Parse HTML files as SHTML

Add this line to your .htaccess file in public_html:
AddHandler server-parsed .html .htm
Now any .html or .htm file will be processed for SSI directives before being sent to the browser.

01. SSI Example

With the handler enabled, you can use includes in your HTML files:

<!--#include virtual="/includes/header.html" -->

<h1>Page Content</h1>
<p>Your page content here.</p>

<!--#include virtual="/includes/footer.html" -->

This is useful for maintaining consistent headers and footers across a static HTML site without using PHP or a CMS.

Modern Alternative

SSI is an older technology. For most use cases today, PHP includes (<?php include 'header.php'; ?>) are more flexible and widely supported. You can also parse HTML files as PHP instead of SHTML. See How to Parse HTML as PHP.

For more on .htaccess configuration, see .htaccess Guide.

Need Help With Server Configuration?

Open a Support Ticket

Quick Recap

  1. Add AddHandler server-parsed .html .htm to .htaccess
  2. Use SSI directives like <!--#include virtual="..." -->
  3. Good for static sites with shared headers/footers
  4. PHP includes are more flexible for modern sites
  5. See Parse HTML as PHP for a PHP-based alternative

Server configuration · Last updated March 2026 · Browse all General articles

  • 484 Users Found This Useful

Was this answer helpful?

Related Articles

Why can users behind proxies not see my site?

General | Updated 2026 If some visitors can see your website but others cannot, and the...

Why Can I Not Ping My Domain

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

Heartbleed Vulnerablity, Risk and Fix

Resolved Vulnerability | 2026 This Vulnerability Was Patched in 2014 Heartbleed...

Is it possible to make a cron to backup my database at specific times?

Hosting Control Panel | Updated March 2026 Yes, you can schedule automatic database backups...

Firewall and Security Protection

General | Updated March 2026 Every server in our hosting fleet is protected by multiple...



Save 30% on web hosting - Use coupon code Hosting30