Forum Discussion
Redirect iRule
Hi
please I want iRule to redirect
http://something.com/abc to http://anything.com/abc
thank you for help...
1 Reply
- VernonWells
Employee
If you are using 11.4.0 or higher, you do not need to use an iRule. Instead, you can use a Local Traffic Policy:
https://support.f5.com/kb/en-us/solutions/public/15000/000/sol15085.html
If you are using a version before 11.4.0, you can use HTTP Classes:
https://support.f5.com/kb/en-us/solutions/public/7000/200/sol7280.html
Using one of these options is generally better than using an iRule. However, for completeness, here is an iRule to accomplish what you desire:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "something.com" } { HTTP::redirect "http://anything.com[HTTP::uri]" } }I assume here that you want to redirect any arbitrary URI path from source to destination, keeping the URI path intact on the redirect.
Recent Discussions
Related Content
* 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