Forum Discussion

Gill_32697's avatar
Gill_32697
Icon for Nimbostratus rankNimbostratus
Oct 06, 2014

irule tcl error Operation not supported.

Started getting these log errors when I added the IF to force WWW, below is a shortened version id the iRule.....not sure how to fix ! !-- Error below ! Mon Oct 6 09:50:41 CDT 2014 err tmm tmm[6950] 01220001 TCL error: /Common/mysiteDotCom_DNN - Operation not supported. Multiple redirect/respond invocations not allowed (line 6) invoked from within "HTTP::redirect "https://autodiscover.mysite.com/AutoDiscover/AutoDiscover.xml"" ("/autodiscover/autodiscover.xml" arm line 2) invoked from within "switch -glob -- [string tolower [HTTP::uri]] { "paymentprocessorv3" - "paymentprocessorakc" { pool IIS_ECM.SWB..." ! !--irule Below... ! when HTTP_REQUEST { if {[string tolower [HTTP::host]] eq "mysite.com" } { HTTP::redirect "https://www.mysite.com[HTTP::uri]" log local0. "adding www" } if { ([string tolower [HTTP::host]]) contains "mysite.com" } { switch -glob -- [string tolower [HTTP::uri]] { "paymentprocessorv3" - "paymentprocessorakc" { pool IIS_ECM.mysite.com_pool } "/autodiscover/autodiscover.xml" { ::redirect "https://autodiscover.mysite.com/AutoDiscover/AtoD iscover.xml" } "/public/hrresume.nsf" { HTTP::redirect "https://mysitecareers.silkroad.com" } pool IIS_mysite.com_pool } default { pool mysiteDNN } }

 

  • Hi Gilbert,

    Your problem is that you have TWO qualifying events:

    1. if {[string tolower [HTTP::host]] eq "mysite.com"

    2. if { ([string tolower [HTTP::host]]) contains "mysite.com"

    You can do this, but you must force processing to stop after the first event. So in your case if the incoming request is for http://mysite.com you want to redirect it to http://www.mysite.com. After the redirect it will not qualify for this first event because the HTTP::host value will be www.mysite.com and not mysite.com.

    You can do this with the "break" command which will tell the iRule to STOP Processing anything else in this iRule.

    As Rolf pointed out you were had an error on one of your lines "::redirect" should be "HTTP::redirect" and I also saw a pool command that did not belong in the switch statement.

    See if this helps:

    when HTTP_REQUEST {
     if {[string tolower [HTTP::host]] eq "mysite.com" } {
           HTTP::redirect "https://www.mysite.com[HTTP::uri]" 
          log local0. "adding www"
         break
       }
       if { ([string tolower [HTTP::host]]) contains "mysite.com" } {
          switch -glob -- [string tolower [HTTP::uri]] {
              "paymentprocessorv3" -
              "paymentprocessorakc" {
                 pool IIS_ECM.mysite.com_pool
                }
               "/autodiscover/autodiscover.xml" {
                  HTTP::redirect "https://autodiscover.mysite.com/AutoDiscover/AtoD iscover.xml"
              }
               "/public/hrresume.nsf" {
                    HTTP::redirect "https://mysitecareers.silkroad.com"
             }
               default { pool mysiteDNN }
          }
       }
    }
    
  • Gilbert,

     

    in the first switch statement the HTTP might miss in front of the ::redirect Beside of that check the syntax.

     

    Rolf

     

  • Hi Gilbert,

    Your problem is that you have TWO qualifying events:

    1. if {[string tolower [HTTP::host]] eq "mysite.com"

    2. if { ([string tolower [HTTP::host]]) contains "mysite.com"

    You can do this, but you must force processing to stop after the first event. So in your case if the incoming request is for http://mysite.com you want to redirect it to http://www.mysite.com. After the redirect it will not qualify for this first event because the HTTP::host value will be www.mysite.com and not mysite.com.

    You can do this with the "break" command which will tell the iRule to STOP Processing anything else in this iRule.

    As Rolf pointed out you were had an error on one of your lines "::redirect" should be "HTTP::redirect" and I also saw a pool command that did not belong in the switch statement.

    See if this helps:

    when HTTP_REQUEST {
     if {[string tolower [HTTP::host]] eq "mysite.com" } {
           HTTP::redirect "https://www.mysite.com[HTTP::uri]" 
          log local0. "adding www"
         break
       }
       if { ([string tolower [HTTP::host]]) contains "mysite.com" } {
          switch -glob -- [string tolower [HTTP::uri]] {
              "paymentprocessorv3" -
              "paymentprocessorakc" {
                 pool IIS_ECM.mysite.com_pool
                }
               "/autodiscover/autodiscover.xml" {
                  HTTP::redirect "https://autodiscover.mysite.com/AutoDiscover/AtoD iscover.xml"
              }
               "/public/hrresume.nsf" {
                    HTTP::redirect "https://mysitecareers.silkroad.com"
             }
               default { pool mysiteDNN }
          }
       }
    }
    
    • Gill_32697's avatar
      Gill_32697
      Icon for Nimbostratus rankNimbostratus
      Ok yes, I see. I'll test this on our next change window. Thanks Guys.
  • Hi Gilbert,

    Your problem is that you have TWO qualifying events:

    1. if {[string tolower [HTTP::host]] eq "mysite.com"

    2. if { ([string tolower [HTTP::host]]) contains "mysite.com"

    You can do this, but you must force processing to stop after the first event. So in your case if the incoming request is for http://mysite.com you want to redirect it to http://www.mysite.com. After the redirect it will not qualify for this first event because the HTTP::host value will be www.mysite.com and not mysite.com.

    You can do this with the "break" command which will tell the iRule to STOP Processing anything else in this iRule.

    As Rolf pointed out you were had an error on one of your lines "::redirect" should be "HTTP::redirect" and I also saw a pool command that did not belong in the switch statement.

    See if this helps:

    when HTTP_REQUEST {
     if {[string tolower [HTTP::host]] eq "mysite.com" } {
           HTTP::redirect "https://www.mysite.com[HTTP::uri]" 
          log local0. "adding www"
         break
       }
       if { ([string tolower [HTTP::host]]) contains "mysite.com" } {
          switch -glob -- [string tolower [HTTP::uri]] {
              "paymentprocessorv3" -
              "paymentprocessorakc" {
                 pool IIS_ECM.mysite.com_pool
                }
               "/autodiscover/autodiscover.xml" {
                  HTTP::redirect "https://autodiscover.mysite.com/AutoDiscover/AtoD iscover.xml"
              }
               "/public/hrresume.nsf" {
                    HTTP::redirect "https://mysitecareers.silkroad.com"
             }
               default { pool mysiteDNN }
          }
       }
    }
    
    • Gill_32697's avatar
      Gill_32697
      Icon for Nimbostratus rankNimbostratus
      Ok yes, I see. I'll test this on our next change window. Thanks Guys.