Forum Discussion
whootang
Nimbostratus
Oct 07, 2017iRule to host multiple site redirects on one VIP
Hi Guys
I am trying to search/figure out is it possible to have one VIP (1 IP address) to host multiple domain redirects.
for example i want to redirect,
sitea.com to google.com
siteb....
Faruk_AYDIN
Altostratus
Oct 07, 2017Hi Guy,
If you want only to HTTP redirect, create a Virtual server, define all DNS records of your sites as this virtual server IP, after that create a data group like the following and add the following iRule to your VS.urllist data group
"sitea.com" := "google.com",
"siteb.com" := "msn.com",
"sitec.com" := "yahoo.com",
when HTTP_REQUEST {
if {[set redir_url [class match -value -- [string tolower [HTTP::host][HTTP::uri]] equals urllist]] ne "" }{
HTTP::redirect $redir_url
}
}
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