I am trying to write a general rule in /WEB-INF/urlrewrite.xml that will take in an arbitrary URI and append the identifiers that follow a root identifier as Name Value Pairs.
For Example:
localhost:8084/URLRewrite/Fruits/Yellow/Banana/banana.jsp
to become
localhost:8084/URLRewrite/Fruits/Yellow/Banana/banana.jsp&key0=Fruits&key1=Yellow&key2=Banana
I know that this will involve regular expressions as well as parameter ambiguity.
Something of similar flavor is like:
<rule>
<from>^/world/([a-z]+)/([a-z]+)$</from>
<to>/world.jsp?country=$1&city=$2</to>
</rule>
Examples:
Input:
<a href="/world/usa/nyc">nyc</a>
Output:
<a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc") %>">nyc</a>
Any help or suggestions would be greatly appreciated.
Try this:
Maybe you're missing the attribute
type
with valueredirect
in your configuration file.