homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

SSI and if-else script

Msg#: 4475752 posted 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?



Msg#: 4475752 posted 6:10 am on Jul 17, 2012 (gmt 0)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved