Forum Discussion
Irule Redirection not working Properly
I have a url hiringmanagement.fmr.com com which should redirect to http://fidelity.taleo.net/smartorg/saml20authnrequestservlet.jss?redirectionURI=https%3A%2F%2Ffidelity.taleo.net%2Fsmartorg%2Fsmartorg%2Fcommon%2Ftoc.jsf%3Flang%3Den .
The irule used is : when HTTP_REQUEST { log local0. "request for [HTTP::host]" if { [string tolower [HTTP::host]] ends_with ".fmr.com"} { set fqdn_check [HTTP::host] } else { set fqdn_check [HTTP::host].fmr.com } log local0. "host [HTTP::host] fqdn_check $fqdn_check" if { ([ class match $fqdn_check contains spaces_sharepoint_redirect_class ]) }{ set redirect [ class match -value $fqdn_check equals spaces_sharepoint_redirect_class ] log local0. "Host: [HTTP::host] -- Redirect: $redirect" HTTP::respond 302 Location "$redirect[HTTP::uri]" } else { HTTP::respond 200 content "Sorry... Location [HTTP::host] not found." } unset fqdn_check }
Right now users getting 500 server error while using hiringmanagement.fmr.com but while using direct url http://fidelity.taleo.net/smartorg/saml20authnrequestservlet.jss?redirectionURI=https%3A%2F%2Ffidelity.taleo.net%2Fsmartorg%2Fsmartorg%2Fcommon%2Ftoc.jsf%3Flang%3Den there’s no error.
I don’t have access to the url so I get a authentication error but looks to me redirection working.
Is the irule correct or do I need to modify. Also can you explain the iruke, how it works?
4 Replies
- nitass
Employee
Is the irule correct or do I need to modify. Also can you explain the iruke, how it works?
i do not see anything obviously wrong.
have you used http analyzer tool? it may be helpful.
HttpFox
https://addons.mozilla.org/en-us/firefox/addon/httpfox/ - dipta_03_149731
Nimbostratus
Hi Nitass, Thanks for replying. Can you explain the irule , since its by someone from F5. Also I was wondering if I can have a simple irule wherein i put any HTTP_Request for hiringmanagement.fmr.com com should go to http://fidelity.taleo.net/smartorg/saml20authnrequestservlet.jss?redirectionURI=https%3A%2F%2Ffidelity.taleo.net%2Fsmartorg%2Fsmartorg%2Fcommon%2Ftoc.jsf%3Flang%3Den.
when HTTP_REQUEST { HTTP::redirect "http://fidelity.taleo.net/smartorg/saml20authnrequestservlet.jss?redirectionURI=https%3A%2F%2Ffidelity.taleo.net%2Fsmartorg%2Fsmartorg%2Fcommon%2Ftoc.jsf%3Flang%3Den) }
- nitass
Employee
Can you explain the irule
the author stores url in data group (spaces_sharepoint_redirect_class) instead of hard-coding it in the irule.
I was wondering if I can have a simple irule wherein i put any HTTP_Request for hiringmanagement.fmr.com com should go to http://fidelity.taleo.net/smartorg/saml20authnrequestservlet.jss?redirectionURI=https%3A%2F%2Ffidelity.taleo.net%2Fsmartorg%2Fsmartorg%2Fcommon%2Ftoc.jsf%3Flang%3Den.
e.g.
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when HTTP_REQUEST { if { [HTTP::host] eq "hiringmanagement.fmr.com" and [HTTP::uri] eq "/" } { HTTP::redirect "http://fidelity.taleo.net/smartorg/saml20authnrequestservlet.jss?redirectionURI=https%3A%2F%2Ffidelity.taleo.net%2Fsmartorg%2Fsmartorg%2Fcommon%2Ftoc.jsf%3Flang%3Den" } } } [root@ve11c:Active:In Sync] config curl -I http://hiringmanagement.fmr.com HTTP/1.0 302 Found Location: http://fidelity.taleo.net/smartorg/saml20authnrequestservlet.jss?redirectionURI=https%3A%2F%2Ffidelity.taleo.net%2Fsmartorg%2Fsmartorg%2Fcommon%2Ftoc.jsf%3Flang%3Den Server: BigIP Connection: Keep-Alive Content-Length: 0 - dipta_03_149731
Nimbostratus
Ok Thanks. So you saying its all same. Yes I do see we have a data group where the redirected URL is present. [root@ltmrtp01:Standby] config tmsh list ltm data-group spaces_sharepoint_redirect_class | grep fidelity.taleo.net data http://fidelity.taleo.net/smartorg/saml20authnrequestservlet.jss?redirectionURI=https://fidelity.taleo.net/smartorg/smartorg/common/toc.jsf?lang=en
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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