Apache 2.4+ Conditional SSI Syntax

295 views Asked by At

I have enabled the SSILegacyExprParser on within the directory and this works....however..I am trying to get an understanding of correct syntax without using the backward compatible Legacy Parser.

I have this written the old way prior to Apache 2.4

<!--#if expr="$lftNav = On && $rtNav = Off"-->
    link to files here
<!--#endif-->

And I rewrote it to this

<!--#if expr="v('lftNav') = 'On' && v('rtNav') = 'Off'"-->
    link to files here
<!--#endif-->

However I can't seem to get this to work correctly. Do I have the syntax correct? Can anyone point me to an example page? The documentation for Apache 2.4 isn't really helping me.

1

There are 1 answers

0
SteveL On BEST ANSWER

Ok...I figured out my issue. I had to re-write it this way to get it to work in Apache 2.4

<!--#set var="lftNav" value="On"-->
<!--#set var="rtNav" value="Off"-->

<!--#if expr="(v('lftNav') = 'On') && (v('rtNav') = 'Off')"-->
    link to files here
<!--#endif-->

In case anyone else was having trouble. I was in the right ballpark.....I just needed to surround each expression in ()