Chapter 3: Condition Reference
slash is always present in the request URL being tested, because the URL is normalized before any comparison is performed. Unless an .exact, .substring, or .regex modifier is used, the pattern specified must include the leading ‘/’ character.
In the following URL example, bolding shows the components used in the comparison; ?q=test is the included query component and #fragment is the ignored fragment identifier:
A URL such as the following is normalized so that a forward slash replaces the missing path component: http://www.example.com becomes http://www.example.com/.
•
The patterns supported by the url.address= test are:
❐
❐
❐
Note that the numeric pattern used to test the url.port condition can contain no whitespace.
•
The query string component of the request URL, if present, consists of all text from the first '?' following the path, to the end of the URL, or up to the first occurrence of '#', whichever comes first. Thus, any fragment identifier that might be present is excluded from the query string component. If there is a query string component at all, then it begins with a '?' character.
•
Discussion
The url= condition can be considered a convenient way to do testing that would require a combination of the following conditions: url.scheme=, url.host=, url.port=, and url.path=. For example,
url=http://example.com:8080/index.html
is equivalent to:
url.scheme=http url.host=example.com url.port=8080 url.path=/index.html
If you are testing a large number of URLs using the url= condition, consider the performance benefits of a url definition block or a [url] section (see Chapter 6: "Definition Reference").
141