Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The Page Library

The Page library provides for access to environment variables. The Page library includes the functions env and url.

The env Function

The page:env function can be used as part of any KRL expression. To retrieve data about the pages environment.

The following parameters can be passed to page:env:

  • caller—the URL of the page on which the ruleset is evaluating
  • ip—IP number of the client
  • rid—the rulesetID
  • rule_version—version number of the ruleset. Not that these are monotonic, but not sequential.
  • title—the page title of the calling page.
  • txn_id—the transaction ID of this ruleset evaluation. 
pre {
  ipAddr = page:env("ip");
}

The url Function

The page:url function can be used as part of any KRL expression. To retrieve data about the page url.

The following parameters can be passed to page:url:

  • protocolthe protocol scheme (e.g. http, https, etc.)
  • hostnamethe complete hostname (e.g. www.windley.com)
  • domainthe domain portion of the hostname (e.g. windley.com)
  • tldthe top-level domain of the hostname (e.g. com, org, net, etc.)
  • portthe port (defaults to 80 if unspecified)
  • paththe path portion of the URL (e.g. /archives/2008/07) 
  • querythe query string, if present (e.g. ?vxx=_ADJKLD&q=foo) 
pre {
  pageProtocol = page:url("protocol");
}

  • No labels