From: Rich Bowen
- # Simple example
- <!--#include virtual="/not-exist.html" onerror="/error.html" -->
-
# Simple example +<!--#include virtual="/not-exist.html" onerror="/error.html" -->+
- # Dedicated onerror paths
- <!--#include virtual="/path-a.html" onerror="/error-a.html" virtual="/path-b.html" onerror="/error-b.html" -->
-
# Dedicated onerror paths +<!--#include virtual="/path-a.html" onerror="/error-a.html" virtual="/path-b.html" onerror="/error-b.html" -->+
The basic flow control elements are:
-
- <!--#if expr="test_condition" -->
- <!--#elif expr="test_condition" -->
- <!--#else -->
- <!--#endif -->
-
<!--#if expr="test_condition" --> +<!--#elif expr="test_condition" --> +<!--#else --> +<!--#endif -->+
The if element works like an if statement in a
programming language. The test condition is evaluated and if
@@ -672,28 +669,20 @@ AddOutputFilter INCLUDES .shtml
The below example will print "from local net" if client IP address belongs to the 10.0.0.0/8 subnet.
-
- <!--#if expr='-R "10.0.0.0/8"' -->
-
- from local net
-
- <!--#else -->
-
- from somewhere else
-
- <!--#endif -->
-
<!--#if expr='-R "10.0.0.0/8"' --> + from local net +<!--#else --> + from somewhere else +<!--#endif -->+
The below example will print "foo is bar" if the variable
foo is set to the value "bar".
- <!--#if expr='v("foo") = "bar"' -->
-
- foo is bar
-
- <!--#endif -->
-
<!--#if expr='v("foo") = "bar"' -->
+ foo is bar
+<!--#endif -->
+See also: Expressions in Apache HTTP Server, @@ -720,14 +709,11 @@ AddOutputFilter INCLUDES .shtml URL, such as a link to that URL. Note that the URL is only tested for whether access would be granted, not whether the URL exists.
-
- <!--#if expr="-A /private" -->
-
- Click <a href="/private">here</a> to access private
- information.
-
- <!--#endif -->
-
<!--#if expr="-A /private" --> + Click <a href="/private">here</a> to access private + information. +<!--#endif -->+
string1 = string2
@@ -748,13 +734,10 @@ AddOutputFilter INCLUDES .shtml
$9. The whole string matched by the regular expression is
stored in the special variable $0
- Example
- <!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" -->
-
- <!--#set var="session" value="$1" -->
-
- <!--#endif -->
-
+ Example
<!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" -->
+ <!--#set var="session" value="$1" -->
+<!--#endif -->
+
string1 < string2
@@ -788,10 +771,9 @@ AddOutputFilter INCLUDES .shtml
"&&" and "||". "!" binds
most tightly. Thus, the following are equivalent:
-
- <!--#if expr="$a = test1 && $b = test2" -->
- <!--#if expr="($a = test1) && ($b = test2)" -->
-
+ <!--#if expr="$a = test1 && $b = test2" -->
+<!--#if expr="($a = test1) && ($b = test2)" -->
+
The boolean operators && and ||
share the same priority. So if you want to bind such an operator more
diff --git a/docs/manual/mod/mod_include.xml b/docs/manual/mod/mod_include.xml
index 9ce2283b02..bedb52281a 100644
--- a/docs/manual/mod/mod_include.xml
+++ b/docs/manual/mod/mod_include.xml
@@ -450,13 +450,17 @@ Options +Includes
default error message will be included.
- # Simple example
- <!--#include virtual="/not-exist.html" onerror="/error.html" -->
+
+# Simple example
+<!--#include virtual="/not-exist.html" onerror="/error.html" -->
+
- # Dedicated onerror paths
- <!--#include virtual="/path-a.html" onerror="/error-a.html" virtual="/path-b.html" onerror="/error-b.html" -->
+
+# Dedicated onerror paths
+<!--#include virtual="/path-a.html" onerror="/error-a.html" virtual="/path-b.html" onerror="/error-b.html" -->
+
@@ -625,10 +629,12 @@ Options +Includes
The basic flow control elements are:
- <!--#if expr="test_condition" -->
- <!--#elif expr="test_condition" -->
- <!--#else -->
- <!--#endif -->
+
+<!--#if expr="test_condition" -->
+<!--#elif expr="test_condition" -->
+<!--#else -->
+<!--#endif -->
+
The if element works like an if statement in a
@@ -658,26 +664,24 @@ Options +Includes
belongs to the 10.0.0.0/8 subnet.
- <!--#if expr='-R "10.0.0.0/8"' -->
-
- from local net
-
- <!--#else -->
-
- from somewhere else
-
- <!--#endif -->
+
+<!--#if expr='-R "10.0.0.0/8"' -->
+ from local net
+<!--#else -->
+ from somewhere else
+<!--#endif -->
+
The below example will print "foo is bar" if the variable
foo is set to the value "bar".
- <!--#if expr='v("foo") = "bar"' -->
-
- foo is bar
-
- <!--#endif -->
+
+<!--#if expr='v("foo") = "bar"' -->
+ foo is bar
+<!--#endif -->
+
Reference Documentation
@@ -706,12 +710,12 @@ Options +Includes
for whether access would be granted, not whether the URL exists.
Example
- <!--#if expr="-A /private" -->
-
- Click <a href="/private">here</a> to access private
- information.
-
- <!--#endif -->
+
+<!--#if expr="-A /private" -->
+ Click <a href="/private">here</a> to access private
+ information.
+<!--#endif -->
+
@@ -734,11 +738,11 @@ Options +Includes
stored in the special variable $0
Example
- <!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" -->
-
- <!--#set var="session" value="$1" -->
-
- <!--#endif -->
+
+<!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" -->
+ <!--#set var="session" value="$1" -->
+<!--#endif -->
+
@@ -774,8 +778,10 @@ Options +Includes
most tightly. Thus, the following are equivalent:
- <!--#if expr="$a = test1 && $b = test2" -->
- <!--#if expr="($a = test1) && ($b = test2)" -->
+
+<!--#if expr="$a = test1 && $b = test2" -->
+<!--#if expr="($a = test1) && ($b = test2)" -->
+
The boolean operators && and ||