Rewriting Redirects
Published May 14, 2008
Version 1.0Was this article helpful?
when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {
Replace absolute redirect with relative redirect
HTTP::header replace Location [regsub {https?://[^/]*/} [HTTP::header value location] "/"]
}
}
Basically it looks for every HTTP location starting with "http://" or "https://" and then looks for any character other than "/"/ and replaces it with a single "/"