Forum Discussion
HTTP redirection irule
Hello Team,
I have created a VIP with IP address : 172.16.214.231. This is for a new website abc.com. The public to private natting happens on the firewall that sits before the F5. The DNS entry of abc.com is mapped with the public IP address.
What i need is when someone enters abc.com he should be directed to abc.com/us/en/product-solutions/transportation/find-a-cellphone-pc.aspx
I believe that this is possible with an irule & i am just a beginner in irules. Kindly advise.
Thank you in advance.
4 Replies
- jdam_41848
Altocumulus
just to be clear, you only want to re-direct a request to the root of the site to /us/en/product-solutions/transportation/find-a-cellphone-pc.aspx?
In other words any other URI is fine as is, you just want to re-direct abc.com/ to abc.com/us/en/product-solutions/transportation/find-a-cellphone-pc.aspx
- Ajit
Altostratus
Hello Jdam,
That is correct. Can you help me with the irule for the same or is there another way i can do it using HTTP class?
Awaiting your response. Thank you.
- Michael_Jenkins
Cirrostratus
You're iRule might look something like this:
when HTTP_REQUEST { switch [string tolower "[HTTP::host][HTTP::uri]"] { "abc.com/" - "www.abc.com/" { HTTP::redirect "/us/en/product-solutions/transportation/find-a-cellphone-pc.aspx" return } } }The other option (if you're using v11.4 or greater) is Local Traffic Policies. Simple actions (including redirects) can be done there and may be simpler to configure if you're not used to iRules. This question has an example that might guide you in the right direction if you wanted to do it that way.
- Ajit
Altostratus
Hi Michael,
I need a little modification in the irule. If you can help me that would be great.
I need abc.com redirected to www.def.com/us/en/product-solutions/transportation/findacellphone-trans.aspx
Thanks in advance !
Ajit
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