Joe_Pipitone
Apr 18, 2012Nimbostratus
Rewrite - is this efficient?
I am trying to rewrite just the domain name itself, while leaving the URI intact. This iRule works, however I am wondering if this is the most efficient way to do this?
I'd like to catch both www.olddomain.com and olddomain .com, and rewrite to newdomain.com while keeping the URI present. This should serve as a wildcard catch-all to cover with and without the www.
www.olddomain.com/path/here.aspx to newdomain.com/path/here.aspx
This is what I came up with, simple enough?
iRule to intercept olddomain.com and www.olddomain .com
Rewrites domain name only, appends URI
when HTTP_REQUEST {
if { [HTTP::host] contains "olddomain" } {
HTTP::redirect "http://newdomain.com[HTTP::uri]"
}
}