Server-side Includes

I’m looking to port a few sites to DreamHost, but don’t want to make any radical code changes. I am concerned about server-side includes on an Apache-hosted DreamHost installation.

For a server-side include, can I include any kind of file or must it have a .shtml file extension…

I talked to someone on Live Chat that insisted that was the case. The Apache documentation says otherwise…

To clarify, from a file named foo.shtml, I want to include the following code:

<!--#include virtual="/include/bar.txt" -->
<!--#include virtual="/include/bar.php" -->
<!--#include virtual="/include/bar.html" -->

I was told by support that these would not work on a DreamHost server. Could someone tell me whether this is the case?


We don’t do anything unusual with regard to SSI, so the Apache documentation is authoritative here. I’ve confirmed that SSI does work in the general case, but I haven’t specifically tested virtual includes.


Can I also surmise that I can expand the file extension support for the including file beyond .shtml by adding a AddHandler directive to .htaccess?

Yes, that’ll work just fine.

Thank you very much!

I do wish the Live Chat support guys would just say “I don’t know” rather than give wrong information. It wasn’t a good initial experience with Dreamhost via Live Chat support and I was really turned off by the smug attitude once I asked “are you sure about that?”. Evoked memories of GoDaddy. I was ready to move on and look for another host as this is a critical issue. I have heard GREAT things about Dreamhost. Anyway, I’m glad I decided to post the question to the forums for a second opinion. I know now where to get answers.

Thanks again