Hi Hborg,
Here is the correct way to do it:
You can rewrite an HTTP header in request packets from a client, response packets from a server, or both, by using the header rewrite command in
action list modify configuration mode. The syntax of this command is as follows:
header rewrite {request | response | both} header_name header-value expression replace pattern
So In your case
action-list type modify http RewriteHost
header rewrite response Host header-value "sefags(.*)" replace "enoviaprod%1"
Be aware that does not redirect the user to enoviaprod. It just forwards the request to the sefags server with the host field rewritten in the http header.
If you want a redirect to a different server, you need to create a redirect service which will send a 302 redirect to the client forcing a new
connection to be open to enoviaprod....
If you want to retain the hostname & Path in user's Http request then %h (for host) & (%p for path) can be used.
There is a known defect related to the Location filed. If this is not spelled exactly like above, we don't catch it.
It might then be necessary to do your own rule to catch the exact field header sent by your server and do your own rewrite.
CSCsu01728
ACE: Regex: HTTP header field name should be case insensitive
Workaround:
Configure a header replace function that will match exactly the field name sent by the server.
ie:
header rewrite response location header-value "http://sefags(.*)" replace "http://enoviaprod%1"
You need to know, that ACE is performing header rewrite just for the first HTTP request or response.
To do rewriting for each request(response) you should use "header modify per-request" in HTTP parameter map,
and attach that parameter map to needed class in global policy.
parameter-map type http RewriteHost
header modify per-request
action-list type modify http RewriteHost
header rewrite response location header-value "http://sefags(.*)" replace "http://enoviaprod%1"
Still you can get back to me for any further discusion.
Sachin Garg