Forum Moderators: phranque

Message Too Old, No Replies

SSI parsing

         

troyaxn

5:52 am on Nov 27, 2006 (gmt 0)

10+ Year Member



i made quite a lot of search regarding on how to enable SSI. of course, i got lots of instructions on how to do that and most of them ONLY specify to use .shtml extension or use XBitHack functionality whenever you dont want to rename all the files to *.shtml.

but i found out that even without using an XBitHack, you can SSI-parse any files by just declaring the way i did like below...

AddHandler server-parsed .shtml .txt .html
AddType text/html .shtml .txt .html

and it works!.

i now wonder why the documentation doesnt mention this kind of approach.
or maybe this approach may have a dire issues!
please let me know if there is any!.

kind regards.

coopster

5:18 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, troyaxn.

The manual does mention this kind of approach, including some of the positives and negatives.
Apache Tutorial: Introduction to Server Side Includes [httpd.apache.org]

<edit>fixed spelling</edit>

[edited by: coopster at 5:45 pm (utc) on Nov. 29, 2006]

jtara

5:32 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This will parse EVERY .html and .txt file.

Of course, this may be just what you want. If you are using SSI to add page structure (header, footer, sidebar, etc.) to every page, it's just what the doctor ordered.

jdMorgan

5:43 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're configuring this in .htaccess, you can also wrap those directives in a <Files> or <FilesMatch> container to specify which filenames they're to be applied to, thus restricting the SSI parsing to a smaller group of filenames. Or you could group the files you do want parsed for SSI into one or a small number of directories, and enable SSI parsing only in the .htaccess files in those directories. Or do both.

Jim