Forum Discussion
Irule
I need a Irule which redirect to http://www.harish.com/ . Any one help us on this irule.
2 Replies
- VernonWells
Employee
Whether or not you can actually do this will depend on what your user-agent (typically a browser) actually sends when you enter . Many user-agents will expand this by affixing a domain from the OS provided search order. If that happens, then the hostname that needs to be redirected is not , but rather something else.
Having said that, there are several ways to handle this. One way is to use an iRule, as you suggest:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "harish" } { HTTP::redirect http://www.harish.com[HTTP::uri] } }I assume here that you wish to maintain whatever request-URI was included in the original request. If you do not want that, you may simply omit the [HTTP::uri] part.
However, if you are using 11.4 or higher, you should consider using a Local Traffic Policy. It is likely faster, and in any case, does not require code:
https://support.f5.com/kb/en-us/solutions/public/15000/000/sol15085.html
If you are using a version before 11.4, you can use an HTTP Class to accomplish this:
https://support.f5.com/kb/en-us/solutions/public/7000/200/sol7280.html
- Harishwar_Reddy
Nimbostratus
Thanks Vernon..I got my answer from my superior..he said we can only redirect to/from fully qualified domain names. http://harish/ is not fully qualified,
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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