Forum Discussion
2 Replies
Sort By
- DevBabuCirrus
May be HTTP::host will help.
Pseudocode
if http host equals oli2 redirect http://oli2.bcbsnj.com
- VernonWellsEmployee
Assuming that you've solved the DNS part, and the fully-qualified domain names are really oli2 and oli2.bcbsnj.com, then, via an iRule:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "oli2" } { HTTP::respond 301 Location "http://oli2.bcbsnj.com" } }
If you only wish to redirect when the request is specifically for "/":
when HTTP_REQUEST { if { [HTTP::path] eq "/" and [string tolower [HTTP::host]] eq "oli2" } { HTTP::respond 301 Location "http://oli2.bcbsnj.com/" } }
If you are using 11.4 or higher, you may also use a Local Traffic Policy: