Forum Discussion
Patrick_Olsen
Nimbostratus
Nov 11, 2011Tomcat
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!
8 Replies
Sort By
- 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] } }
- nitass
Employee
just in case if you have not seen this. - Patrick_Olsen
Nimbostratus
many thanks to both of you. I have not seen the 5-Minute iRules and Kurt thank you. - Patrick_Olsen
Nimbostratus
Unfortunately 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? - nitass
Employee
can 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_Olsen
Nimbostratus
Hi nitass, - Michael_Yates
Nimbostratus
Hi Patrick, - nitass
Employee
Michael, 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