Forum Discussion
Cap and not Cap uri
Hi,
i have the below irule
When HTTP_REQUEST {
if { [HTTP::host] equals " www.abc.com"
switch -glob [HTTP::path]
{ "/App/Events/Calendar.aspx"
{HTTP::respond 301 Location "https://www.def/redirect/Calendar.aspx" }
}
{ "/App/events/Calendar.aspx"
{HTTP::respond 301 Location "https://www.def/redirect/Calendar.aspx" }
}
{ "/app/Events/Calendar.aspx"
{HTTP::respond 301 Location "https://www.def/redirect/Calendar.aspx" }
}
My question is how to make this irule simple, can i use string tolower for this case? and how do i apply it to this irule.
Thanks in advance.
Glad could be of help, would you mind marking the solution as answer provided, so it can help others too.
Yes you can use string to lower,
when HTTP_REQUEST { if { [HTTP::host] equals "www.abc.com" } { switch -glob [string tolower [HTTP::path]] { "/app/events/calendar.aspx" { HTTP::respond 301 Location "https://www.def/redirect/Calendar.aspx" } default { pool default_pool } } } }
- Were you able to test this.
- Hien_TruongCirrus
i just completed all my test cases after applying this new irule. it works, thanks a lot for your support.
Glad could be of help, would you mind marking the solution as answer provided, so it can help others too.
- Hien_TruongCirrus
How do I mark the solutions as answer provided? I would like to do it.
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