Forum Discussion

Habib_Ulla_Khan's avatar
Habib_Ulla_Khan
Icon for Nimbostratus rankNimbostratus
Dec 19, 2016

Irule to redirect when request is https.

Hi All,

I am using below mentioned irules. when using http i can see it redirects to https for telecombil.calls.com and also uri is appended. When i use https directly i dont get redirection working and page is not displayed.

**http irule:**
    when HTTP_REQUEST {
if { [HTTP::host] equals "telecombil.calls.com" } {
HTTP::redirect "https://telecombil.calls.com/staff"
} else {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"  
}
}

**Below is the irule use in https VIP**
    when HTTP_REQUEST { 
     Check requested host header (set to lowercase) 
    switch -glob [string tolower [HTTP::host]] {
    "telecombills.calls.com" {
    SSL::disable serverside
   if { [string tolower [HTTP::host]] equals "telecombil.calls.com" } {
   HTTP::redirect "https://telecombil.calls.com`text`/staff" 
    pool telecombills-pool-http
    }
    "cam.calls.com" {
    SSL::enable serverside
    pool cam-https-pool 
    }
    "toolboxremote.calls.com" {
    SSL::disable serverside
    pool toolboxremote-pool 
    }

1 Reply

  • Can you use CURL to identify the HTTP response ? What is the request and what is the response that you are getting ?