Forum Discussion
VJ_96387
Nimbostratus
Feb 22, 2010URL REDIRECTION!!!
Hi there,
I am near to F5 irules and need your help regarding the below requirement.
I need to redirect the
http://abc-a.xyz.com (accessed via internet)
https://abc-a.xyz.com (accessed via internet)
http://abc-a.xyz.corp (accessed internally)
https://abc-a.xyz.corp (accessed internally)
to be redirected to
https://abc-a-xyz.corp/irj/portal
The VIP is on a single host 10.10.10.10 and runs service ports on 80 and 443.
Please help me on howto accomplish this via Irules?
Awaiting your response.
TIA
Regards,
VJ
5 Replies
- hoolio
Cirrostratus
Hi VJ,
You can check the URI (everything after the hostname[:port] in the URL) using HTTP::uri or the path (URI minus the query string) using HTTP::path. You can rewrite the URI and path with these same commands. Or you can send a 302 redirect using HTTP::redirect.
If you want to redirect all requests to / to /irj/portal, you can use:when HTTP_REQUEST { Check requested URI if {[HTTP::uri] eq "/"}{ Redirect client HTTP::redirect "https://abc-a-xyz.corp/irj/portal" } }
Aaron - VJ_96387
Nimbostratus
Aaron,
Thanks for your reply. Assume yow want me to apply this irule to all both VIP's.
i.e. 10.10.10.10:80 & 10.10.10.:443.
Please advise?
TIA
VJ - hoolio
Cirrostratus
That's correct. The rule can be applied to all VIPs where you want to redirect the client from / to the URL.
Note that I incorrectly had the event for the rule set to CLIENT_ACCEPTED. That needs to be HTTP_REQUEST instead.
Aaron - VJ_96387
Nimbostratus
Thanks Aaron... IT worked!!! - VJ_96387
Nimbostratus
Thanks Aaron... IT worked!!!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
