bdragna_8791
Feb 25, 2008Nimbostratus
HTTP Redirect/Rewrite iRule question
I'm kind of new to this, so I'm not even sure if what I'm trying to do is possible or if I'm going about it all wrong.
When the client's web browser makes a request to "host.domain.com" I want the browser to redirect to a different website called "domain.domainnew.com", but I want the client web browser to continue showing the original domain "host.domain.com" in the address bar.
I'm assuming this would require a redirect to "domain.domainnew.com" and then replace/rewrite the host header during the HTTP Response with the original domain "host.domain.com".
when HTTP_REQUEST {
set domain [getfield [HTTP::host] "." 2]
set host [HTTP::host]
set uri [HTTP::uri]
if { not ($domain equals "domainnew") } {
HTTP::redirect https://$domain.domainnew.com$uri }
}
when HTTP_RESPONSE {
HTTP::header replace Host "www.domain.org"
log local0. "Host header replaced: [HTTP::host]"
}
Any help would be appreciated.
I'm logging for HTTP Request and Response information and it looks like it's working from the log information, but the client web browser address bar does not continue to show the original domain.