Forum Discussion
need multi layer redirect
I quess I still haven't gotten the hang of writing these rules.
here is what i need to be able to accomplish
needhelp.ou.edu/library => https://ounew.service-now.com/forms/walkin_bizzell.do needhelp.ou.edu/couch => https://oudev.service-now.com/forms/walkin_couch.do needhelp.ou.edu/el => https://oudev.service-now.com/forms/walkin_el.do needhelp.ou.edu/oneu => https://oudev.service-now.com/forms/walkin_oneu.do
"needhelp.ou.edu" only should go to http://itscnorman.ou.edu/contact/
when HTTP_REQUEST { if { [HTTP::host header] is needhelp.ou.edu and {http::uri starts_with “/library” } { HTTP::redirect “https://ounew.service-now.com/forms/walkin_bizzell.do” if { [HTTP::host header] is needhelp.ou.edu and {http::uri starts_with “/couch” } { HTTP::redirect “https://oudev.service-now.com/forms/walkin_couch.do” if { [HTTP::host header] is needhelp.ou.edu and {http::uri starts_with “/el” } { HTTP::redirect “https://oudev.service-now.com/forms/walkin_el.do ” if { [HTTP::host header] is needhelp.ou.edu and {http::uri starts_with “/oneu” } { HTTP::redirect “https://oudev.service-now.com/forms/walkin_oneu.do” if { [HTTP::host header] is “needhelp.ou.edu” } { HTTP::redirect "http://itscnorman.ou.edu/contact"} } } } } } }
2 Replies
- arpydays
Nimbostratus
I would use a switch command as it's a bit more efficient, also for posting code here use the Preformatted code button on the irule text so it's more readable,
cheers
when HTTP_REQUEST { switch [string tolower [HTTP::host]] { "needhelp.ou.edu" { switch -glob [string tolower [HTTP::uri]] { "/" { HTTP::redirect "http://itscnorman.ou.edu/contact/" } "/library*" { HTTP::redirect "https://ounew.service-now.com/forms/walkin_bizzell.do" } "/couch*" { HTTP::redirect "https://oudev.service-now.com/forms/walkin_couch.do" } "/el*" { HTTP::redirect "https://oudev.service-now.com/forms/walkin_el.do" } "/oneu*" { HTTP::redirect "https://oudev.service-now.com/forms/walkin_oneu.do" } } } } } - Gary_Bristol_19
Nimbostratus
Yes that worked fine. I was also contemplating using an internal Data Group, but I couldn't get the needhelp.ou.edu/ to redirect.
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
