Forum Discussion
need help for some specific uri redirection from http to https
Hi my requirement is like some applications should NOT re-direct to https and some of them applications can re-direct to https For this i have created below Irule but it is not taking If i remove https redirection then it is working. please help me for the same.
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "abc.com" } { if { ([string tolower [HTTP::uri]] starts_with "/Customer_Portal") or ([string tolower [HTTP::uri]] starts_with "/CustomerFeedback") or ([string tolower [HTTP::uri]] starts_with "/Dimension") or ([string tolower [HTTP::uri]] starts_with "/Pages") or ([string tolower [HTTP::uri]] starts_with "/Sales_Portal") or ([string tolower [HTTP::uri]] starts_with "/XMLApplication") or ([string tolower [HTTP::uri]] starts_with "/Encer_Integration") } then { pool test_pool } elseif{ (HTTP::redirect "https://[HTTP::host][HTTP::uri]" ) } else { pool UAT_pool } } }
6 Replies
- nitass
Employee
since you use string lower, uri must be in lower case e.g. /customer_portal
if { ([string tolower [HTTP::uri]] starts_with "/Customer_Portal")and i do not think this part is correct.
} elseif{ (HTTP::redirect "https://[HTTP::host][HTTP::uri]" ) } else { pool UAT_pool } - together_183451
Nimbostratus
Hi, can you please write complete irule here..
- together_183451
Nimbostratus
i know, that part is not correct can you help me how i will write the irule
- nitass
Employee
i know, that part is not correct can you help me how i will write the irule
i do not know your requirement. anyway, this is just an example.
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when HTTP_REQUEST { if { [HTTP::host] equals "abc.com" } { switch -glob [HTTP::path] { "/Customer_Portal*" - "/CustomerFeedback*" - "/Dimension*" - "/Pages*" - "/Sales_Portal*" - "/XMLApplication*" - "/Encer_Integration*" { Do something } default { Do something } } } else { Do something } } } - together_183451
Nimbostratus
i don't want to redirect towards pool. I have default pool but some uri do not redirect towards https
- nitass
Employee
i don't want to redirect towards pool. I have default pool but some uri do not redirect towards https
can you more specific please? so, i can add it into the irule.
now, i do not even know what some uri is. :)
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