Forum Discussion
rwagner1
Nimbostratus
Sep 25, 2018Multi site redirect using host headers
We have a VIP setup which uses host headers.
I would like an iRule to redirect the main domain to the sub domain for all the sites using the same VIP, and still send it to the sub domain pool.
E...
youssef1
Cumulonimbus
Sep 25, 2018Hi,
you can use this irule without redirect but just rewrite host header:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"abc.com" {
pool "www.abc.com"
HTTP::header replace Host "www.abc.com"
}
"abc.com" {
pool "www.mno.com"
HTTP::header replace Host "www.mno.com"
}
"xyz.com" {
pool "www.xyz.com"
HTTP::header replace Host "www.xyz.com"
}
default {
do nothing
}
}
}
if you want use redirect just replace:
HTTP::header replace Host "www.abc.com"
by
HTTP::redirect "https://www.abc.com[HTTP::uri]"
regards,
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