Forum Discussion
ronniep_79067
Nimbostratus
Nov 13, 2009Help: Force to use DNS name
I have been looking for a while, but cannot locate any information. Is there a way one can use and irule to force a user to use dns as apposed to an IP address to connect to a server? Any help would b...
hoolio
Cirrostratus
Nov 13, 2009Hi Ronnie,
You could check the Host header value for at least one alpha character. If there isn't one, then redirect to a hardcoded hostname with the original URI:
when HTTP_REQUEST {
Check if host header value contains at least one alpha character
if { not ([ string match -nocase "*\[a-z\]*" [HTTP::host] ])}{
Redirect client to the correct hostname, preserving the original URI
HTTP::redirect "http://www.example.com[HTTP::uri]
}
}
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