Answer ID: 9008

Our website uses "shtml" files instead of "html" files (including the "index.shtml" file). How can we get the server to recognize these file types, and use the "index.shtml" file as the default index file?

SSI stands for server side includes, these are special HTML tags which you can include in your HTML documents to call CGI scripts or other HTML content. This is particularly useful, for example to include a navigation menu in your HTML documents, it allows you to use one document to display the navigation menu in all your other documents. This saves disk space and means if you need to update the content, you only need to modify one file.

The use of "shtml" files can be enabled in the Plesk Control Panel by creating a ".htaccess" file and adding some code to the .htaccess file to let the server know that "shtml" files are valid.

To create a .htaccess file using the Plesk web hosting control panel:

  • From the control panel homepage, go to "Domains"
  • Click on the domain you want to modify
  • Go to "File Manager"
  • In the root file directory or the directory where the website is stored (usually "httpdocs" or "httpsdocs"),  go to "Add New File".
  • Click the check-mark "File Creation"
  • Name the file ".htaccess"
  • Click "OK"

Once the ".htaccess" file is created, then you can add the code necessary to make "shtml" files be recognized by the server.

To enable SSI, after the .htaccess file is created (you can also edit an existing .htaccess file), place the following code in it:

AddType text/html .shtml
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes

Note: to enable SSI for your full web site place the .htaccess in the root directory of your site; to enable it for just a certain directory place the .htaccess file only in that particular directory.

The first line of the code above tells the server that .shtml is a valid extension. The second line adds a handler to all pages with the .shtml extension which tells the server to parse (process) the document for server side includes.

If you want to use SSI in your default directory page, such as index.shtml you may need to add the following to the .htaccess file:

DirectoryIndex index.shtml index.htm

This means that index.shtml can be your default page. If this page is not found the server will look for index.htm etc. More on this in the .htaccess guides section.