david0512_20548
Oct 27, 2014Nimbostratus
irule to rewrite header but respond with 200
Hi All,
Im trying to setup an irule (and struggling :-)) that will perform the following. Upon accessing a site, the request will be rewritten to essentially send the client elsewhere, however rather than providing a 301/302 redirect I need a 200 response to be sent to the client for the initial request.
For example once this rule is setup, a request for a page www.test.com/p/content/ will result in a 200 response for the user. This will work using the URL handling rule sending requests ahead without generating a response to the user and the 200 response coming from www.test.com.
the irule below seems to direct the user correctly but I cant seem to force the 200 response
When HTTP_REQUEST {
if { [HTTP::host] contains "www.test." and [HTTP::uri] starts_with "/p/" } {
HTTP::header replace Host "www.test.com"
}
}