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,
If you want a generic Irule, you can use something like that:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]
if {!($host starts_with "www.") and ($host ends_with "com")} {
set host2 "www.[string tolower [HTTP::host]"
HTTP::header replace Host $host2
}
}
if you want use redirect just replace:
HTTP::header replace Host $host2
by
HTTP::redirect "https://$host2[HTTP::uri]"
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