PathRegex

Overview

The <PathRegex> element is used to apply content settings to requests whose path matches a regular expression. The query string, if any, is NOT included in the comparison.

Regular expressions apply to the remainder of the path that is being compared and do not "nest", so if you care what's after the part you're matching, then compose your expression to check for the entire match you want.

Reference

Attributes

Content Specifiers

Names

Type

Req?

Default

Description

Names

Type

Req?

Default

Description

regex 

string

Y



Specifies the regular expression to apply

caseSensitive 

boolean



false

Controls the case sensitivity option of the regular expression engine

Content Settings

The element supports a large number of XML attributes corresponding to the content settings supported by the SP:

Child Elements

Access Control 

Nested Content Specifiers

Name

Cardinality

Description

Name

Cardinality

Description

<Query>

0 or more

Matches requests containing a matching query string parameter

For more details on how the request mapping process works, see the HowTo.

Example

As with the example in the <Path> topic, this scenario doesn't actually warrant a separate <Path> element since the "secure/" string could be prefixed to the demonstrated expression.

<RequestMapper type="Native"> <RequestMap applicationId="default"> <Host name="sp.example.org"> <Path name="secure"> <PathRegex regex="(en|de|it|fr)/create/new/class" caseSensitive="false" authType="shibboleth" requireSession="true"> <AccessControl><NOT><Rule require="affiliation">student</Rule></NOT></AccessControl> </PathRegex> </Path> </Host> </RequestMap> </RequestMapper>