Forum Moderators: phranque
I've got a forum which generates its pages using a template and cgi script. I've set the script to insert a server side include in each page for ad rotation. So, for example, the script might stuff this into each page:
<!--#include virtual="/cgi-bin/program.cgi" -->
The problem is that this code gets stuffed into files at various directory levels, e.g.,
mysite.com/file.htm
mysite.com/dir/file2.htm
mysite.com/dir/sub/file3.htm
The relative path to the script changes for each file. So, if the code works at one level it's broken on the others. Is there a way to do an include of this type with an absolute reference? Is a BASE tag a workable approach?
[hoohoo.ncsa.uiuc.edu...]
I suspect something is mis-configured, but I don't know where or how. A work-around might be to use mod_rewrite and a very unique script filename, and rewrite all requests for that script to a fixed directory path.
<added>
Another option is to leave out "virtual" and use a full URL:
<!--#include="http://www.yourdomain.com/cgi-bin/program.cgi" -->
</added>
Jim
<Directory "c:/yoursite/mainfolder">
Options +Includes
</Directory>
I had forgotten the + in front of Includes, after I put it back in, everything worked fine, that's using the absolute path to the root of your site, not your server, like /cgi-bin/filename.cgi
Actually, I think you could just add the line:
Options +Includes
to the .htaccess file, try it and see.