When there is any error within DataPower I am trying to redirect the user to a custom page on a different server, which after fixing the issue will redirect the user to the DP page with the right info in the query string. I have an error map with an XSLT as below and the WAF has the Follow Redirects as on. When there is any error the XSL is getting called but the user's browser is not being redirected and resulting in an error "The website cannot display the page". But if I specify a Default Error Policy with Mode as Redirect then the user's browser is being redirected to the specified URL.
<dp:set-http-response-header name="'x-dp-response-code'" value="'302 redirected'" />
<dp:set-http-response-header name="'Location'" value="$dpconfig:AccEnableURL" /> where AccEnableURL is http://126.96.36.199:80/accapp/enable.jsp
Please let me know if I am missing anything here.
Pinned topic Web Application Frewall redirect in the error map is not working
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-01-04T03:06:19Z at 2013-01-04T03:06:19Z by SystemAdmin
HermannSW 2700006U545219 Posts
Re: Web Application Frewall redirect in the error map is not working2012-12-31T17:59:15ZThis is the accepted answer. This is the accepted answer.Hi,
I do not have access to my DataPower boxes currently.
But "x-dp-response-code" is not a normal HTTP header field,
The x-dp-response-code special code is a protocol response code that is returned to the DataPower® server. This special code is not a field that is included in the response header. This special code contains the protocol-specific response code.
and therefore "dp:set-http-response-header()" cannot be used for it.
I just referred to this posting in another thread on how to set the HTTP response code:
That will work for "normal" HTTP response codes.
If your client application will treat the 302 redirect, everything will be fine.
In case you want DataPower to do the redirected request, that has to be done differently.
Hermann <myXsltBlog/> <myXsltTweets/>Updated on 2014-03-25T02:43:59Z at 2014-03-25T02:43:59Z by iron-man
SystemAdmin 110000D4XK6772 Posts
Re: Web Application Frewall redirect in the error map is not working2013-01-04T03:06:19ZThis is the accepted answer. This is the accepted answer.
- HermannSW 2700006U54