Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

SSI and if-else script



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

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"' -->
<!--#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?


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

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

Featured Threads

Hot Threads This Week

Hot Threads This Month