Forum Discussion

KJ_50941's avatar
KJ_50941
Icon for Nimbostratus rankNimbostratus
Sep 28, 2012

iRule hlep

I need to redirect from http to https , also since some users have bookmark specific port for exmaple port 8050 in their browser to be redirect to https. how do I do that.

 

 

does this works?

 

 

when HTTP_REQUEST {

 

if { ([HTTP::uri] eq "/")}{

 

HTTP::redirect ""

 

}

 

}

 

when HTTP_REQUEST_SEND {

 

clientside {

 

if { ( ($example_host eq "example.com") } {

 

HTTP::header replace Host "example.com:8050"

 

}

 

}

 

}

 

 

Thx

 

14 Replies

  • do I need to change 80 to all port or create new VIP with all portyou can change this virtual server port 80 to any port.

     

     

    can this iRule work for redirect on *_VS ? i think you should use the one nathan suggested.
  • Thx, and this :when HTTP_REQUEST {

     

    HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]

     

    }

     

     

    will be applied to all port VIP?

     

     

    Thx again
  • will be applied to all port VIP? yes. please be noted that non-http traffic will be dropped.