Forum Discussion
hassan_35513
Nimbostratus
Oct 14, 2008Rewrite 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.
hoolio
Cirrostratus
Oct 15, 2008I'm not sure whether it would be more efficient to rewrite all host headers to www.mydomain.com or check if the host header isn't www.mydomain.com and then rewrite it. Here is an example of the latter:
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects