Skip to main content

HomeAll guides

Turning On Server-Side Includes for Your cPanel Domain

How to enable SSI on a cPanel domain

To turn on Server-Side Includes (SSI) for a domain in cPanel, you need to modify the handler for that domain so the server processes SSI directives in your HTML files. The steps differ slightly depending on whether your host uses Apache or LiteSpeed, but both routes start in cPanel's File Manager or by editing your domain's configuration file directly.

The most common method is to add an SSI handler through cPanel's MultiPHP Manager or by creating or editing an .htaccess file in your domain's public_html folder. If your host uses Apache, the .htaccess route works on most shared hosting accounts. If LiteSpeed is running, you may need to use cPanel's native tools instead.

Key Takeaways

  • SSI must be enabled at the domain level in cPanel, not globally, so each domain you own can have different settings.
  • The .htaccess method works on Apache servers and requires adding two lines that tell the server to parse HTML files for SSI commands.
  • If .htaccess changes do not work, your host may use LiteSpeed, and you will need to use cPanel's MultiPHP Manager or contact support to enable the SSI handler.
  • After enabling SSI, test it by creating a straightforward HTML file with an SSI command like <!--#echo var="DATE_LOCAL" --> to confirm the server is processing includes.

Enabling SSI through .htaccess on Apache

The .htaccess method is the fastest route on Apache servers. Log into cPanel, open File Manager, navigate to the public_html folder for the domain you want to modify, and create a new file called .htaccess if one does not already exist. If a .htaccess file is already there, open it and add the lines below at the end.

Add these two lines to your .htaccess file:

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

The first line tells the server to treat .shtml files as HTML. The second line tells Apache to parse both .html and .shtml files for SSI commands. Save the file. SSI should now work on that domain within a few minutes.

If you want SSI to work only on files with the .shtml extension instead of all .html files, use only the second line and change .html to .shtml. This is safer if you have many HTML files and want to avoid the server parsing every one for SSI commands, which uses slightly more processing power.

Using cPanel's MultiPHP Manager for LiteSpeed

If your host runs LiteSpeed instead of Apache, the .htaccess method may not work. Log into cPanel and look for MultiPHP Manager in the Software section. Click on it, select the domain you want to modify, and look for an option to set the PHP handler or enable SSI.

Some hosts display an SSI checkbox directly in MultiPHP Manager. If you see one, check it and save. If you do not see an SSI option, contact your host's support team — they may need to enable it at the server level before you can turn it on per domain.

LiteSpeed configurations vary by host, so the exact steps depend on how your provider set up cPanel. Your host's documentation or support team can confirm whether SSI is available on your plan and how to enable it.

Testing SSI after you enable it

After you enable SSI, create a test file to confirm the server is processing includes. In File Manager, create a new file in your public_html folder called test-ssi.shtml (or test-ssi.html if you enabled SSI for .html files). Add this single line:

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

Save the file, then visit it in your browser at yourdomainname.com/test-ssi.shtml. If SSI is working, you will see the current date and time displayed on the page. If you see the SSI command itself printed as text instead, SSI is not yet enabled or the server has not reloaded the configuration yet — wait a few minutes and refresh the page.

Why SSI might not work after you enable it

The most common reason SSI does not work is that the .htaccess file is in the wrong folder. Make sure it is in the public_html folder for the specific domain, not in a parent folder or a subfolder. If you have multiple domains on one cPanel account, each domain's public_html folder needs its own .htaccess file if you want SSI on all of them.

Another reason is that your host may have disabled SSI at the server level for security reasons. Some shared hosting providers do not allow SSI on their plans. If your test file still shows the SSI command as text after waiting several minutes, contact your host and ask whether SSI is supported on your account.

File permissions can also block SSI. Make sure your .htaccess file has permissions set to 644 (readable by everyone, writable only by you). In File Manager, right-click the .htaccess file, select Permissions, and set it to 644 if it is different.

Disabling SSI if you no longer need it

To turn off SSI, delete or comment out the two lines you added to .htaccess. Open the .htaccess file in File Manager, remove or add a # symbol at the start of each SSI line, and save. The changes take effect within a few minutes.

If you used cPanel's MultiPHP Manager to enable SSI, uncheck the SSI option in that tool and save. If you are unsure which method your host uses, check your .htaccess file first — if the SSI lines are not there, you probably enabled it through MultiPHP Manager.

Frequently Asked Questions

Do I need to enable SSI for every domain on my cPanel account?

No. Each domain's public_html folder is separate, so you can enable SSI on one domain and leave it off on others. Add the .htaccess file only to the domains where you need SSI.

What is the difference between .html and .shtml files?

There is no technical difference — both are HTML files. The .shtml extension is a convention that signals to the server "this file uses SSI, please parse it." Using .shtml lets you enable SSI only on files that need it, which saves server resources. Using .html means every HTML file on your domain gets parsed, even if it does not use SSI.

Can I use SSI with PHP on the same domain?

Yes. SSI and PHP work independently. You can have .php files and .shtml files on the same domain, and both will work. The server processes PHP first, then SSI, so you can even use SSI commands inside PHP output.

Why does my host say SSI is not supported?

Some hosts disable SSI for security reasons or because they use only LiteSpeed without SSI modules installed. If your host says SSI is not supported, it is not available on your plan, and no .htaccess change will enable it. You may need to switch hosts or use PHP includes instead, which work on all hosting plans.

This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.