Reputation: 26809
Could you help me with implementation Filter which will modify all request to files /DIR/* into /NEW_DOMAIN/NEW_CONTEXT_PATH/DIR/*
Upvotes: 0
Views: 151
Reputation: 597046
/DIR/*
Use
response.sendRedirect(NEW_DOMAIN + "/" + NEW_CONTEXT + request.getPathInfo())
(see getPathInfo()
). Note that if it's possible to have a query-string (?foo=bar
), you'd have to append it as well.
Upvotes: 2
Reputation: 1349
Probably could but are you sure that is what you want? You could also use mod_rewrite with your reverse proxy (example for Apache and mod_rewrite):
RewriteEngine on
RewriteRule ^/DIR/(.*)$ /NEW_DOMAIN/NEW_CONTEXT_PATH/DIR/$1 [R]
Upvotes: 0