Forum Discussion

rposey_79430's avatar
rposey_79430
Icon for Nimbostratus rankNimbostratus
Nov 28, 2007

HTTP to HTTPS with a URI and PromoCode

I have two scenarios I need iRules written for and I am having trouble finding a forum thread that related to my setup. I have generic HTTP to HTTPS iRules, but nothing that modifies the domain and URI.

 

 

==========================================

 

 

Scenario 1

 

! Redirect a HTTP request to HTTPS and append a URI on the redirect.

 

Example:

 

http://ABC.com redirected to https://ABC.com/Consumer/Login.do

 

 

==========================================

 

Scenario 2

 

! Redirect a HTTP request from a specific branded site to a generic HTTPS site with a URI/PromoCode

 

Example:

 

http://ABC.com redirected to https://genericsite.com/Consumer/Landing.do?promoCode=ABC

 

 

==========================================

 

 

If someone cold assist me with how this would work I would appreciate it.

1 Reply

  • Here are two rules which do a static redirect for all requests to the same URL. If you want something more dynamic that either of these, can you elaborate on the logic of what to redirect to?

    
     Scenario 1, redirect HTTP requests to HTTPS with a modified URI
    when HTTP_REQUEST {
       HTTP::redirect https://ABC.com/Consumer/Login.do
    }

    
     Scenario 2, redirect HTTP requests to HTTPS with a modified URI
    when HTTP_REQUEST {
       HTTP::redirect https://genericsite.com/Consumer/Landing.do?promoCode=ABC
    }

    Aaron