Forum Discussion

Harry1's avatar
Harry1
Icon for Nimbostratus rankNimbostratus
Feb 15, 2019

need to redirect http in https but facing some issue

Hi,

 

i have applied a default irule in http vs to redirect into https and also applied one more irule on https vs because some of the pages are still on http not in https when testing via debugger. now entire URL is redirecting everytime in https.

 

now how can i stop some of the page to be redirected in https? they should be in http only.

 

3 Replies

  • Hello Harry,

     

    Can you post your redirect iRule? I'm willing to bet that you could change your redirect iRule to ignore certain URIs but seeing the actual iRule would help everyone troubleshoot.

     

    Best of luck,

     

    Austin

     

    • Harry1's avatar
      Harry1
      Icon for Nimbostratus rankNimbostratus

      Hi , below are both irules: one is applied on HTTP VS and another on HTTPS

       

      Irule—applied in HTTP VS

       

      when HTTP_REQUEST { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] }

       

      Irule applied in HTTPS VS

       

      when HTTP_RESPONSE { Check if response type is text if {[HTTP::header value Content-Type] contains "text"}{ Replace http:// with https:// STREAM::expression {@@} Enable the stream filter for this response only STREAM::enable } }

       

    • AMiles_377865's avatar
      AMiles_377865
      Icon for Cirrocumulus rankCirrocumulus

      Alright cool. Yeah so just change the iRule on your HTTP VS to only affect specific URIs. Depending on how many different URIs you want redirected/not redirected it might be easier to add exceptions to either your HTTPS or HTTP traffic but it's your call.

       

      Here's some pseudo-code.

       

      when HTTP_REQUEST {  
          if     {  [HTTP::uri] eq    }
        HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]    
        }

      or something like that.