Forum Discussion
Tom_White_69772
Nimbostratus
Mar 16, 2007Redirect Irule on V4.5.10
We have created a VIP for URL "itrequest.mycompany.usa.com" but want the users to only have to enter "itrequest.mycompany.com" or "request.mycompany.com". Being first-time irule novices, what's the best way to write this iRule? We've tried this,but it's not working. How do we incorporate both URIs to the single URL?
if (http_uri == "/") {
redirect to "http://www.mycompany.com"
}
else {
redirect to "http://www.mycompany.com +httpuri
}
- Martin_MachacekHistoric F5 AccountYou need to keep in mind that the difference in your URLs is in the hostname component not the path. There are 2 possible solutions:
rule redirect_to_main_url { redirect to "http://itrequest.mycompany.usa.com" + http_uri }
rule redirect_to_main { if(http_host != itrequest.mycompany.usa.com) { redirect to "http://itrequest.mycompany.usa.com" + http_uri } else { use pool } }
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