hassan_35513
Oct 15, 2008Nimbostratus
Rewrite IP to Host name
I have client connecting to 1.1.1.1 and I want to rewrite their request to www.mydomain.com. I also have clients going directly to www.mydomain.com.
What is the best way to doing it.
What is the best way to doing it.
when HTTP_REQUEST {
Check if requested host is noto www.mydomain.com
if {not ([string tolower [HTTP::host]] eq "www.mydomain.com")}{
Redirect client to www.mydomain.com
HTTP::redirect "http://www.mydomain.com"
}
}
If the VIP is HTTPS, you could change the redirect to https://www.mydomain.com.
Aaron
when HTTP_REQUEST {
Check if requested host is not www.mydomain.com
if {not ([string tolower [HTTP::host]] eq "www.mydomain.com")}{
Rewrite host to www.mydomain.com
HTTP::header replace Host "www.mydomain.com"
}
}
Aaron