Hamster_2020
Nov 19, 2013Nimbostratus
HTTP to HTTP 301 Redirect with URI
At present I have the following irule:
when HTTP_REQUEST {
if { [HTTP::host] equals "domain.co.uk"} {
HTTP::respond 301 Location "http://www.domain.co.uk/"
}
}
Which seems to work but redirects all matching traffic to the root of http://www.domain.co.uk/. What I need is an irule that brings the URI in the request into the 301 response.
So I wonder whether the following would work:
when HTTP_REQUEST {
if { [HTTP::host] equals "domain.co.uk"} {
HTTP::respond 301 Location "http://www.domain.co.uk[HTTP::uri]"
}
}