Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Using SSI inside includes

Convince apache with XBitHack to process SSI from includes garned from SSI

7:14 pm on May 13, 2005 (gmt 0)

10+ Year Member

In my .htaccess I have XBitHack on, and I have set chmod +x .index.html. Within index.html I have the following line of SSI: <!--#include file="./header.inc" -->. This works great.

Within header.inc I would like to also include more SSI to dynamically determine if an element should be of the active class. It looks like this: <!--#if expr="$DOCUMENT_NAME = index.html" --> class="active" <!--#endif -->. This works if the code is directly inside index.html, but not if the include is garned from SSI within index.html.

I would really appreciate your help with this.

7:55 pm on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Did you set the x bit for the header.inc file too? If you want to process SSI inside header.inc, you'll need to do this.

Note also that if your Last-Modified dates are important to you -- if you are concerned with cacheability management -- you may want to look into using XBitHack Full and setting the Group x bit as well.


8:40 pm on May 13, 2005 (gmt 0)

10+ Year Member

Yes I had done chmod +x header.inc. I just had the hunch to rename it to header.html and repeat the chmod and now it works. I'm not sure what the cause of this problem is, as I am not directing the server to process any specific type of file, but only those with the x bit set.

I'm OK with it as .html though so problem solved!

9:33 pm on May 13, 2005 (gmt 0)

10+ Year Member

Because I have a mix of php and python includes as well it has turned out to be important to figure out why it only accepts the .html extension. If you had some ideas on that it would be a great help.
9:46 pm on May 13, 2005 (gmt 0)

10+ Year Member

Perhaps I can go at this a more round-about way for the php files, and change the directory index for that folder to index.html, and inside index.html use SSI to do a virtual include of the php file. I'll try it when i get back =)
10:26 pm on May 13, 2005 (gmt 0)

10+ Year Member

Looks like i'm cured. PHP has a function called virtual (link [us3.php.net]) that is the corellary to apache's!

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month