Adding rewrite URL rules
Add a rewrite URL rule, which examines the URL of every request and determines if a pattern matches, in PingAccess.
Before you begin
Confirm that you are not using the agent model. Rewrite URL rules aren’t available for agent deployments.
About this task
When you define a regular expression in a rule (such as regex
), and if a pattern matches, PingAccess uses the information configured in the rewrite URL rule and rewrites that portion of the Uniform Resource Locator (URL) into a path that the site can understand.
To add a rewrite URL rule:
Steps
-
Click Access and then go to Rules → Rules.
-
Click Add Rule.
-
In the Name field, enter a unique name for the rule up to 64 characters.
Special characters and spaces are allowed.
-
In the Type list, select Rewrite URL.
-
In the Map From field, enter the
regex
of the URL path and the query you want to match.Example:
^/bank/(.*)
This example illustrates matching the
Request-Line
in the request. TheRequest-Line
begins with/bank/
(the^
indicates "begins with") and places the rest of the URL into the first capture group.For more information on
regex
patterns, see the Oracle Java Docs. -
In the Map To field, enter the URL path and the query that you want to generate.
Example:
/application/$1
This example defines the replacement string, which generates
/
followed by the content of the first capture group.To better understand the use of special characters, such as
\
and$
, in the replacement string, see the Oracle Java Docs. -
Click Save.
Rewrite URL rule configuration examples
This table displays four examples of rewrite URL rule configurations in PingAccess.
Map from value | Map to value | Example request | Rewrite by PingAccess |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|