Forum Discussion

missionOne_6216's avatar
missionOne_6216
Icon for Nimbostratus rankNimbostratus
Aug 11, 2010

Conversions from v4 [ignore the other 3 posts! :/ ]

So aparently DevCentral doesn't like Chrome. Things timed out when I last clicked post, then suddenly there were 3 copies, and no formatting. :/

 

 

Lets try again, IE seems to be required to play well here. :/

 

 

I Need some assistance on converting the following simple v4 rules to something that will load on v9.

 

The owner of the unit is not iRules knowledable but is responsible for getting the box migrated to v9.4.8

 

Some can be incorporated via v9 http class redirects, but we would still like to have the syntaxes.

 

 

1proxy

 

if (server_port == 80)

 

{ redirect to "https://%h/%u" }

 

else { discard }

 

 

 

HostRedirect

 

if (http_host == "host.com" and http_uri == "/")

 

{ redirect to "https://www.host.com" }

 

else { discard }

 

 

PortRedirect

 

if (server_port == 80)

 

{ redirect to "https://%h/%u" }

 

else { discard }

 

 

mail_https_to_http

 

if (server_port == 443)

 

{ redirect to "https://www.mail.host.com" }

 

else { discard }

 

 

URI+Host-Redirect

 

if (http_host == "www.host.com" and http_uri == "/myuri")

 

{ redirect to "www.host.com" }

 

else { discard }

 

 

NotesMailRedirect

 

if (http_uri == "/")

 

{ redirect to "https://mail.host.com" }

 

else { discard }

 

 

mail_Redirect_by_host

 

if (http_host contains "mail.host.com")

 

{ redirect to "https://www.mail.host.com" }

 

else { discard }

 

 

 

3rdPartyRedirect

 

if (http_host contains "3rdpartyhost.host.com")

 

{ redirect to "https://www.3rdpartyhost.host.com" }

 

else { discard }

 

 

 

Thanks in advance, and sorry for the posting fubar. I'd delete the others, but can't see how to in the forum options. :/

 

 

-m1

1 Reply

  • Hi m1,

    Ignore my other reply about formatting. Here are a few examples converted. If you get stuck on any of the others, reply here and we can help.

    if (server_port == 80)

    { redirect to "https://%h/%u" }

    else { discard }

    when HTTP_REQUEST {
    
       switch [TCP::local_port] {
          80 {
             HTTP::redirect "https://[HTTP::host][HTTP::uri]"
          }
          default {
             discard
          }
       }
    }
    

    if (http_host == "host.com" and http_uri == "/")

    { redirect to "https://www.host.com" }

    else { discard }

    when HTTP_REQUEST {
    
       if {"[string tolower [HTTP::host]][HTTP::uri]" eq "/"}{
          HTTP::redirect "https://www.host.com"
       } else {
          discard
       }
    }
    

    if (http_uri == "/")

    { redirect to "https://mail.host.com" }

    else { discard }

    when HTTP_REQUEST {
       if {[HTTP::uri] eq "/"}{
          HTTP::redirect "https://mail.host.com"
       } else {
          discard
       }
    }
    

    Aaron