Forum Discussion

Julian_Grunnell's avatar
Julian_Grunnell
Icon for Nimbostratus rankNimbostratus
Sep 11, 2008

HTTPS to HTTP redirect

Hi - can anyone help with an iRule for the above please? I see and use iRules in the opposite direction!!

 

 

I'd like all HTTPS requests to be redirected to a HTTP virtual server WITH THE EXCEPTION of requests for https://site-name/contact/

 

 

Any ideas?

 

 

Thanks - J.

4 Replies

  • Ah some progress but another problem as well.

     

     

    If I use a HTTP Class I can do the HTTPS to HTTP redirect but it breaks my "EXCEPTION" above - ie. I must have all requests for http://site-name/contact/ to goto the HTTPS VS. All other HTTPS requests must goto the HTTP VS. And any HTTP requests can goto the HTTP VS as expected.

     

     

    J.
  • Spoke to soon - no it isn't. Bet you can do this with the HTTP Class and a regex to redirect everything except the contact/ page.

     

     

    J.
  • How about a string comparison in an iRule?

       
       when HTTP_REQUEST {   
          
          if {[HTTP::uri] starts_with "/contact")}{   
          
              Redirect to http 
             HTTP::redirect "http://[HTTP::host][HTTP::uri]"   
          }   
       }   
       

    Aaron