Conditions

Info: The URL Rewriter feature in Bloomreach Content requires a standard or premium license. Contact Bloomreach for licensing details.

Overview

Conditions define the criteria that must be met for a URL Rewriter rule to be applied. You can configure rules to require that either all conditions match, or that at least one condition matches. The order of conditions can affect rule evaluation.

Condition Types

Each condition type specifies a property of the incoming request or server environment to evaluate.

TypeDescription
headerEvaluates the value of a specific HTTP header. Specify the header name using the name attribute.
methodChecks the HTTP method of the request (e.g., GET, POST, HEAD).
portChecks the port on which the web application server is running.
timeEvaluates the current server time as the number of seconds since 00:00:00 UTC, January 1, 1970 (Unix time). Use this to control when content becomes available.
yearChecks the current year on the server. See Calendar.YEAR.
monthChecks the current month on the server (January is 0). See Calendar.MONTH.
dayofmonthChecks the day of the month on the server (March 1 is 1). See Calendar.DAY_OF_MONTH.
dayofweekChecks the day of the week on the server (Saturday is 1, Sunday is 7). See Calendar.DAY_OF_WEEK.
ampmChecks whether the server time is AM or PM. See Calendar.AM_PM.
hourofdayChecks the hour of the day (24-hour clock) on the server (e.g., 22 for 10 PM). See Calendar.HOUR_OF_DAY.
minuteChecks the minute value of the current server time. See Calendar.MINUTE.
secondChecks the second value of the current server time. See Calendar.SECOND.
millisecondChecks the millisecond value of the current server time. See Calendar.MILLISECOND.
attributeEvaluates the value of a request attribute. Specify the attribute name using the name parameter. See request.getAttribute(name).
auth-typeChecks the authentication type of the request. See request.getAuthType().
character-encodingChecks the character encoding of the incoming request. See request.getCharacterEncoding().
content-lengthChecks the content length of the incoming request. Useful for restricting large requests. See request.getContentLength().
content-typeChecks the content type of the incoming request. See request.getContentType().
context-pathChecks the context path of the incoming request. See request.getContextPath().
cookieEvaluates the value of a specific cookie. Specify the cookie name using the name parameter. See request.getCookies().
parameterChecks the value of a request parameter (from GET or POST). Specify the parameter name using the name parameter. See request.getParameter(name).
path-infoChecks the path info of the request. See request.getPathInfo().
path-translatedChecks the translated path of the request. See request.getPathTranslated().
protocolChecks the protocol used for the request (e.g., HTTP/1.1). See request.getProtocol().
query-stringChecks the query string of the request, if present (e.g., id=2345&name=bob). See request.getQueryString().
remote-addrChecks the IP address of the client making the request. See request.getRemoteAddr().
remote-hostChecks the host name of the client making the request. Host name resolution must be enabled on the server. See request.getRemoteHost().
remote-userChecks the authenticated user making the request, if available. See request.getRemoteUser().
requested-session-idChecks the session ID specified by the client. See request.getRequestedSessionId().
requested-session-id-from-cookieChecks if the session ID comes from a cookie. See request.isRequestedSessionIdFromCookie().
requested-session-id-from-urlChecks if the session ID comes from the URL. See request.isRequestedSessionIdFromURL().
requested-session-id-validChecks if the session ID is valid. See request.isRequestedSessionIdValid().
request-uriChecks the request URI, which includes the path from the protocol up to the query string. See request.getRequestURI().
request-urlChecks the reconstructed URL used by the client, including protocol, server name, port, and path (excluding query parameters). See request.getRequestURL().
session-attributeChecks the value of a session attribute. Specify the attribute name using the name parameter. See session.getAttribute(name).
session-isnewChecks if the session is new. See session.isNew().
server-nameChecks the host name of the server that received the request (from the Host header). See request.getServerName().
schemeChecks the scheme used for the request (e.g., http, https). See request.getScheme().
user-in-roleChecks if the user is in a specific role. The value cannot be a regular expression. See request.isUserInRole(value).

Types Requiring Additional Parameters

Some condition types require you to specify an additional parameter, such as a name.

TypeRequired Parameter
headerName of the HTTP header to evaluate
attributeName of the request attribute to evaluate
cookieName of the cookie to evaluate
parameterName of the request parameter to evaluate
session-attributeName of the session attribute to evaluate

Operator

The operator defines how the condition is evaluated against the value. For example, you can check for equality, inequality, or use pattern matching depending on the condition type.

Value

Specify the value to compare against the evaluated type. The value is used in conjunction with the operator.

Logical Operator for Chaining Conditions

When multiple conditions are defined, you can control how they are combined:

  • Use AND to require that this condition and the next condition both match.
  • Use OR to require that either this condition or the next condition matches.

This allows you to create complex rule logic by chaining multiple conditions together.

Share Feedback
Page: /build/enterprise-plugins/url-rewriter/conditions
Section: Build
Category *
Conditions | Bloomreach Content Documentation