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, 2008You can redirect to the www.mydomain.com domain if the requested host header isn't www.domain.com:
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
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