Joyent

Enabling Server Side Includes

Server Side Includes (SSI) are not enabled by default. If you need to enable them, put the following in a .htaccess file in your document root directory (web/public):

Options +Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
DirectoryIndex index.shtml

Once enabled, SSI will also run under suexec (securely spawning processes under your username).

If you’re getting a 500 error after editing the .htaccess file, it’s most likely because you’ve entered an extra space in one of the commands or you’re using a Windows editor and it’s putting in DOS carriage returns in the file.

Troubleshooting

For the include files (e.g. snippets you call from your main HTML files), make sure you use extensions that Apache will recognize and know how to handle. For instance, if you like to name all your include files with an extension of ‘inc’, they will refuse to render out of the box, because Apache doesn’t recognize the ‘inc’ extension. Either use ‘html’, or define the handling of ‘inc’ files:

AddType text/html .inc
 
shared/kb/server-side-includes.txt · Last modified: 2008/02/20 08:46 by filip
 
Recent changes RSS feed Creative Commons License Driven by DokuWiki