Forum Discussion
John_Merritt_45
Nimbostratus
Nov 06, 2006Need help with multi domain url rewrite
I am new to the iRule world. I have multiple domains that I need to rewrite. The first group should all rewrite to the same url. However I have another domain that I want to rewrite to a second url...
Colin_Walker_12
Nov 06, 2006Historic F5 Account
You've got the right idea, but you can combine that logic into one switch statement.
Try something like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host] ] {
"*abc.com" -
"*def.com" -
"*ghik.com" -
"*lmnop.com" {
HTTP::redirect "http://www.xzy.com/content.cfm?pageid=11049]"
}
"order.ace.com" {
HTTP::redirect "https://catalog.acme.com"
}
}
}
This allows you to expand easily as well, by adding more domains to the list above "lmnop.com" if you need to have more perform the same action later.
HTH,
Colin
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