Splash › Forums › PrettyFaces Users › Rewrite rule to page with an anchor
Tagged: rewrite anchor hash
This topic contains 1 reply, has 2 voices, and was last updated by Lincoln Baxter III 10 years, 3 months ago.
I’m trying to write rewrite rule to url with anchor, but I don’t know how to disable coding hash on substitute param.
My example rewrite rule
<rewrite match=”/galleries/(w+)/note/(w+)” substitute=”/galleries/$1#note_$2″ />
rewrites url /galleries/123/note/123 to /galleries/123%23note_123, instead of /galleries/123#note_123
Can anybody help ?
I’m not sure this is possible it seems that we are always encoding the full URL, so this would have to happen after encoding. We don’t currently support that in a convenient way, sadly.
However, you could do the redirection yourself using the rewrite com.ocpsoft.pretty.faces.rewrite.Processor class, using the HttpServletResponse.sendRedirect(…) method:
(the docs are slightly outdated, there are now two methods to implement.
The forum ‘PrettyFaces Users’ is closed to new topics and replies.
Comments are closed.
If you find our tools useful, please consider making a donation to help us stay online and building software!