Forum Discussion
Anuj_Chaudhary_
Nimbostratus
Jul 06, 2016Need help on redirection
Hi All,
Pls. help how we can redirect the below URL :
http:\oli2 application should redirect to http:\oli2.bcbsnj.com
Regards, AC
VernonWells
Employee
Jul 06, 2016Assuming 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:
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