Forum Moderators: phranque

Message Too Old, No Replies

SSI and if-else script

         

numnum

2:15 am on Jul 15, 2012 (gmt 0)

10+ Year Member



What I'm trying to do seems very basic: In a site's navigation menu, show a page title in plain text only if that page is displayed. Otherwise, show it as anchor text linking to the page. Very basic.

I'm using static HTML, no PHP. I'm following the Apache documentation that describes how to show foo only if the file is "foo.html" -- otherwise show something else. But it's just not working. (The Apache server software is up to date.) Here's the idea (for Apache 2.0):

<!--#if expr='"$DOCUMENT_URI" = "/foo.html"' -->
foo
<!--#else -->
<a href="foo.html">foo</a>
<!--#endif -->


I've also tried this alternative (for Apache 1.3):

<!--#if expr="\"$DOCUMENT_URI\" = \"/foo/file.html\"" -->

Nada for both methods. No error message, just inert. What am I not getting?

numnum

6:10 am on Jul 17, 2012 (gmt 0)

10+ Year Member



Okay, I just figured it out. I needed to indicate the full path name.