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.mycompany.com which resolves to the VIP address of 172.21.61.3 on port 80. Behind this VIP, I only have one test web server (172.21.69.3) that has a basic splash page. I created a new IRule called Test-redirect which is set to redirect to another internal web server...here is the rule:
when HTTP_REQUEST
{ if {[HTTP::uri] equals {test.corp.mycompany.com/1}}
{HTTP::uri {inside.corp.mycompany.com} } }
I applied this IRule to my VIP but when I go to http://test.corp.mycompany.com/1 , I don't get redirected but get a 404 error instead.
Can anyone help me get this working?
thanks
jack
- Michael_YatesNimbostratusHi jackster,
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/1" } { HTTP::uri "/inside.corp.mycompany.com" } }
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/1" } { HTTP::redirect "http://inside.corp.mycompany.com" } }
- jackster_47376Nimbostratus
That worked perfectly for me...thank you so much!
jack
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