Forum Discussion
Osiolek_69514
Nimbostratus
Aug 02, 2010Is something like that do-able?
Hi all,
I have three DNS records:
a.x.com --> 1.1.1.1
b.x.com --> (alias) --> a.x.com
c.x.com --> 2.2.2.2
As you can see both a.x.com and b.x.com point to the same Virtual Server (1.1.1.1). I want to create an iRule which will do the following:
1) if someone enters a.x.com, I want to update the URL to c.x.com and redirect him VS 2.2.2.2.
2) if someone enters b.x.com, I want to preserve the url (b.x.com), but still redirect him to VS 2.2.2.2
I do not have problem implementing (1), but I am stuck on how to achieve (2).
Please advise.
- The_Bhattman
Nimbostratus
Hi Osiolek,when HTTP_REQUEST { switch -glob [HTTP::host] { "a.x.com" { HTTP::redirect "http://c.x.com" } "b.x.com" { virtual } } }
- Osiolek_69514
Nimbostratus
Thanks for answering my questions. - hoolio
Cirrostratus
You can resolve a host name to an IP address using NAME::lookup in 9.x or RESOLV::lookup in 10.1 and higher. - Joe_Wojcik
Employee
It sounds like what you want is for the client to still see b.x.com in their browser bar but connect to the IP address of c.x.com instead, correct? - Osiolek_69514
Nimbostratus
Thank you gents. I will investigate both solutions. - hoolio
Cirrostratus
iRules should trigger regardless of whether the virtual command is used. I'd try adding debug logging to both iRules and check the output in /var/log/ltm. If you want help diagnosing the issue post anonymized copies of the two rules, virtual server definitions and logs. Or you could open a case with F5 Support.
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