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 17, 2009If you want to redirect a client that requests www.example.com to example.com, you could use an iRule like this:
when HTTP_REQUEST {
Check requested hostname (set to lower case)
if {[string tolower [HTTP::host]] eq "www.example.com"}{
Redirect client to example.com with the same URI
HTTP::redirect "http://example.com[HTTP::uri]
}
}
If this is for an HTTPS virtual server that both www.example.com and example.com resolve to, you would need to get a cert which is valid for example.com and www.example.com. You can get a 'Unified Communications Certificate' for this. Try searching these forums or the internet for details on this.
Aaron
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