Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Cap and not Cap uri

Hien_Truong
Cirrus
Cirrus

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.

 

1 ACCEPTED SOLUTION

 

 

Glad could be of help, would you mind marking the solution as answer provided, so it can help others too.

View solution in original post

5 REPLIES 5

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_Truong
Cirrus
Cirrus

​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_Truong
Cirrus
Cirrus

​How do I mark the solutions as answer provided? I would like to do it.