Forum Discussion
jackster_47376
Oct 14, 2011Nimbostratus
Newbie IRule Question on Redirects
I'm sorry but I'm relatively new to IRules and am having trouble getting an IRule to redirect to another site when traffic comes into a VIP.
I have this internal URL: http://test.corp.mycomp...
Michael_Yates
Oct 14, 2011Nimbostratus
Hi jackster,
Try this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/1" } {
HTTP::uri "/inside.corp.mycompany.com"
}
}
This will not change the URI in the browser. It will change the URI that is sent to the server.
The Browser will show: http://http://test.corp.mycompany.com/1
The Server will receive: http://test.corp.mycompany.com/inside.corp.mycompany.com
So you may want to analyze what you are wanting. You might want to change the the iRule to this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/1" } {
HTTP::redirect "http://inside.corp.mycompany.com"
}
}
This will redirect you to a different website (http://inside.corp.mycompany.com).
Hope this helps.
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