In total there are 12 rules, 3 outbound rules and 11 conditions in the configuration file.
A test rule to show a simple redirect.
URL's matching /test/status/ will be redirected to /rewrite-status.
This rule and it's conditions will use the regex matching engine.
URL's matching logo.gif will permanent-redirect to http://127.0.0.1:8080/urlrewrite/artifact_type.gif.
This rule and it's conditions will use the regex matching engine.
Allows users to type product id's into urls.
ID's published in magazine.
URL's matching /products/*/*/ will be forwarded to /products.jsp.
This rule and it's conditions will use the regex matching engine.
This rule will set:
request object called categoryId to the value null
request object called usingFilter to the value yes
URL's matching /chairs/*/ will be forwarded to /products/chairs.jsp.
This rule and it's conditions will use the regex matching engine.
This rule will set:
session object called chairShopper to the value true
URL's matching /test/disabled/ will be redirected to /rewrite-status.
This rule and it's conditions will use the regex matching engine.
Given that the following conditions are met.
user-agent HTTP header does NOT match the value mac
and
dayofmonth is equal to the value 14
and
charset HTTP header matches the value utf
and
user-in-role is equal to the value admin
URL's matching /test/disabled/.
This rule and it's conditions will use the regex matching engine.
Given that the following condition is met.
user-agent HTTP header does NOT match the value mac
This rule will set:
request object called blah to the value ass
cache-control HTTP response header to ass
Note, other rules will be proessed after this rule.
URL's matching /test-set/([0-9]+) will be forwarded to /test-set.jsp.
This rule and it's conditions will use the regex matching engine.
Given that the following condition is met.
user-agent HTTP header does NOT match the value mac
This rule will set:
request object called num to the value num
This rule will run:
run on an instance of org.tuckey.web.filters.urlrewrite.TestRunObj
run on an instance of org.tuckey.web.filters.urlrewrite.TestRunObj
nonDefaultRun on an instance of org.tuckey.web.filters.urlrewrite.TestRunObj
nonDefaultRun on an instance of org.tuckey.web.filters.urlrewrite.TestRunObj
(a new instance will be created for each rule match)
nonDefaultRun on an instance of org.tuckey.web.filters.urlrewrite.TestRunObj
(a new instance will be created for each rule match)
init(ServletConfig) or destroy() is found on the above objects they will be run at when creating or destroying an instance.
URL's matching /content/([a-zA-Z]+).
This rule and it's conditions will use the regex matching engine.
This rule will set:
request object called contentItem to the value $1
This rule will run:
doGet on an instance of org.tuckey.web.filters.urlrewrite.TestServlet
init(ServletConfig) or destroy() is found on the above object they will be run at when creating or destroying an instance.
Note, other rules will be proessed after this rule.
URL's matching /pref/([a-zA-Z]+).
This rule and it's conditions will use the regex matching engine.
Given that the following condition is met.
method is equal to the value POST
This rule will run:
doPost on an instance of org.tuckey.web.filters.urlrewrite.TestServlet
init(ServletConfig) or destroy() is found on the above object they will be run at when creating or destroying an instance.
Note, other rules will be proessed after this rule.
URL's matching /test-redirect-301 will permanent-redirect to /is-this-301.
This rule and it's conditions will use the regex matching engine.
URL's matching /test-redirect-302 will temporary-redirect to is-this-302.
This rule and it's conditions will use the regex matching engine.
URL's matching /test-redirect-302 will temporary-redirect to is-this-302.
This rule and it's conditions will use the regex matching engine.
Given that the following condition is met.
user-in-role is equal to the value devil
Outbound URL's matching /page-not-for-devils(0-9)? will be rewritten to /devils-page, after response.encodeURL() has been called.
Given that the following condition is met.
user-in-role is equal to the value devil
Outbound URL's matching ^(.*);jsessionid=.*$ will be rewritten to $1.
Given that the following condition is met.
user-agent HTTP header matches the value googlebot.*
Outbound URL's matching *;jsessionid=* will be rewritten to $1, after response.encodeURL() has been called.
Given that the following condition is met.
user-agent HTTP header matches the value googlebot*