Reply To: A HREF rewrite PROXY

Splash Forums Rewrite Users A HREF rewrite PROXY Reply To: A HREF rewrite PROXY

#26599

Yes, changing the URLs of a rendered HTML page is possible using outbound rewrites.

However, this only works, if the URLs are passed through HttpServletResponse.encodeURL(). If the URLs are hardcoded in the HTML page, things are getting more difficult. To modify these URLs, you will have to buffer the response created by the Servlet and postprocess it. There is some support for this in Rewrite. Have a look at the rewrite-transform-* modules. They are used to (for example) minify JS and CSS files. This is basically the same thing as modifying parts of the HTML page. You will have to implement your own Transformer for this. Have a look at the showcase app for transformations for examples:

https://github.com/ocpsoft/rewrite/tree/master/showcase/transform