Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know if it's possible to write a perl script that will check whether SSI is available on a server? I am using the free host www.togetherhost.com and their FAQ and help files don't mention SSI anywhere and their support team hasn't gotten back to me and it's been about three weeks.

Replies are listed 'Best First'.
Re: checking for SSI?
by Callum (Chaplain) on Feb 04, 2004 at 11:02 UTC
    Sure, just use LWP::UserAgent to submit the search terms "SSI +site:togetherhost.com" to google, then use the same script to pull the page www.togetherhost.com/hostplans.html

    In the ancient and sage words of the philosopher Neil Gaiman -- "Google is your friend. Google loves you. Google wants you to be happy".

    Less sarcasticly, although individual webservers may broadcast that information, it is generally not going to be available by querying the server, even if it was you can't assume that because the hosting company's server does/dosn't have SSI enabled the same will be true for customer sites they host.

Re: checking for SSI?
by ColtsFoot (Chaplain) on Feb 04, 2004 at 11:05 UTC
Re: checking for SSI?
by Theo (Priest) on Feb 04, 2004 at 15:16 UTC
    The most certain way is to create a small web page, include some SSI, name it with an SHTML extention and upload it.
    <html><head><title>SSI test page</title> </head> <body> <h1>SSI test page</h1> <hr/> <!--#echo var="SERVER_NAME" --> <br/> <!--#echo var="Document_URI" --> <br/> <!--#echo var="LAST_MODIFIED" --> <br/> <hr/> </body></html>
    But if they haven't gotten back to you in 3 weeks, it might be time to look for a new host. The host I use usually responds within 24hrs.

    -Theo-
    (so many nodes and so little time ... )

      Thank you so much Theo. I was using .html and I couldn't think for the life of me why my SSI code was showing up in the sorce code and not being executed. On all my other sites I use .html with SSI and it works, but rename it to .shtml surely did the trick. Thanks!
        There are several ways to "enable" SSI. I think most of them are covered here along with tutorial info. The HtmlGoodies site has more tutorial stuff.

        Here's another site with SSI tutorials, including techniques I've not seen elsewhere.

        -Theo-
        (so many nodes and so little time ... )