Forum Discussion
Patrick_Olsen
Nov 11, 2011Nimbostratus
Tomcat
I'm new to iRules and have been doing some research here. I have tried multiple redirect scenarios and they all seem to fail.
Current try looks like this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "blah/manager/status" and [string tolower [HTTP::uri]] eq "/" } { HTTP::redirect } }
What am I missing?
Thanks!
- What am I missing?
if { [string tolower [HTTP::host]] eq "blah/manager/status"
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "www.domain.com" and [string tolower [HTTP::uri]] eq "blah/manager/statusblah/manager/status" } { HTTP::redirect http://www.blah.com[HTTP::uri] } }
- nitassEmployeejust in case if you have not seen this.
- Patrick_OlsenNimbostratusmany thanks to both of you. I have not seen the 5-Minute iRules and Kurt thank you.
- Patrick_OlsenNimbostratusUnfortunately Kurt your suggestion didn't appear to work. I'm basically trying to make it so that whenever anyone requests the tomcat manager page it redirects them to the main host URL. Anyone have a good idea for this?
- nitassEmployeecan you try this?
[root@ve1023:Active] config b virtual bar list virtual bar { snat automap pool foo destination 172.28.65.152:http ip protocol tcp rules myrule profiles { http {} tcp {} } } [root@ve1023:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "blah" and [string tolower [HTTP::uri]] equals "/manager/status"} { HTTP::redirect "http://blah" } } } [root@ve1023:Active] config curl -I http://blah/manager/status HTTP/1.0 302 Found Location: http://blah Server: BigIP Connection: Keep-Alive Content-Length: 0
- Patrick_OlsenNimbostratusHi nitass,
- Michael_YatesNimbostratusHi Patrick,
- nitassEmployeeMichael, thanks!
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