Forum Discussion
Preet_pk
Feb 04, 2022Cirrus
Multiple domain redirection
Hi, There is one requirement to redirect 2 Host domains - lab.com -> https://lab.com/bluelab/login.html uatlab.com -> https://uatlab.com/bluelab/login.html We are using single Virtual Server & H...
Feb 04, 2022
Hi Preet_pk,
You are probably getting a tcl error, you can see it in the ltm logs.
https://support.f5.com/csp/article/K23237429
when HTTP_REQUEST {
if {[HTTP::has_responded]} { return }
if {[HTTP::host] equals "lab.com" and [HTTP::uri] equals "/"} {
HTTP::redirect "https://lab.com/bluelab/login.html"
return
elseif {[HTTP::host] equals "uatlab.com" and [HTTP::uri] equals "/"} {
HTTP::redirect "https://uatlab.com/bluelab/login.html"}
return
}
}
shorter:
when HTTP_REQUEST {
if { [HTTP::has_responded] } { return }
if { [HTTP::uri] eq "/" and ([HTTP::host] eq "lab.com" or [HTTP::host] eq "uatlab.com") } {
HTTP::redirect "https://[HTTP::host]/bluelab/login.html"
return
}
}
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