Forum Discussion

dolly_pandit's avatar
dolly_pandit
Icon for Nimbostratus rankNimbostratus
Jun 02, 2020
Solved

IRULE FOR HTTP to HTTPS REDIRECTION FOR ALL TRAFFIC EXPECT SOME URI

HI Everyone,

 

I am looking for an irule where i need to redirect all the traffic from http to https expect for some URI's.

example: URI's: /abc , /bbc, /xyz anything starting with URI's traffic shouldn't be redirected.

 

Irule i wrote for working only for one URI but not for multiple , can some one help me how the irule looks for multiplr URI?

 

when HTTP_REQUEST {

    if {not ([string tolower [HTTP::path]] starts_with "/abc")}{

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

     

}

}