cancel
Showing results for 
Search instead for 
Did you mean: 

SSI not working

N/A

SSI not working

Like fontaine posted in Running a CGI by loading, I am trying to run includes:
<!--#include virtual="cgi-bin/foo.cgi">
without success.

The cgi script itself is running fine, but the ssi (which works fine on the old server) refuses to play ball, putting the text of the script into the html page rather than the result.

Includes calling non-cgi content
<!--#include virtual="footer.html" -->
seem to work fine.

FWIW I'm on /files/home1
2 REPLIES
N/A

Sorted!

Tech support said I needed a .htaccess file, and told me to search the forums - but that wasn't entirely helpful.

So, for the benefit of anyone else with this problem - here's a step by step guide to making this work:

If you follow the advise of taskforce9 in this post:
http://portal.free-online.net/central/forums/viewtopic.php?t=701&highlight=htaccess+ssi+cgi
you will find out how to enable SSI using a .htaccess file containing the following code:
AddType text/html .shtml

AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes

This turns on SSI, but it doesn't solve the cgi problem. For that, you'll need to add the line:
AddHandler cgi-script .cgi

so that the entire .htaccess file looks like this:
AddType text/html .shtml

AddHandler server-parsed .shtml
AddHandler cgi-script .cgi
Options Indexes FollowSymLinks Includes


Hope that prevents anyone else having a stressful couple of days!
slev
Grafter
Posts: 357
Registered: 30-07-2007

SSI not working

Hi offbeat

Thanks for your work on this I am sure there will be some members who will need this information.

Kind Regards

Ian