Forum Discussion

Shohab_Baig_841's avatar
Shohab_Baig_841
Icon for Nimbostratus rankNimbostratus
May 03, 2007

Using I-rule to redirect traffic to https

Hi - We have approx. 20-25 pages on our website which needs to be secured. I am using following I-rule to do it. Following is a sample what I am writnng to make those pages secure:

 

 

when HTTP_REQUEST {

 

switch -glob [HTTP::uri] {

 

"/" {

 

HTTP::redirect "https://www.efreightquote.com/membersite/ACH/Default.aspx"

 

}

 

"/MakePayments.asp" {

 

HTTP::redirect "https://www.efreightquote.com/membersite/ACH/MakePayments.asp"

 

}

 

"/Signin.aspx" {

 

HTTP::redirect "https://www.efreightquote.com/Signin.aspx"

 

}

 

"/PaymentReport.asp" {

 

HTTP::redirect "https://www.efreightquote.com/membersite/ach/PaymentReport.asp"

 

}

 

"/ApproveInvoices.asp" {

 

HTTP::redirect "https://www.efreightquote.com/membersite/ach/ApproveInvoices.asp"

 

}

 

"/AuditInfo.asp" {

 

HTTP::redirect "https://www.efreightquote.com/membersite/ach/AuditInfo.asp"

 

}

 

"/BilledInfo.asp" {

 

HTTP::redirect "https://www.efreightquote.com/membersite/ach/BilledInfo.asp"

 

}

 

"/CreditCard.aspx" {

 

HTTP::redirect "https://www.efreightquote.com/QSTP/CreditCard.aspx"

 

}

 

"/Default.aspx" {

 

HTTP::redirect "https://www.efreightquote.com/Default.aspx "

 

}

 

default {

 

use pool www_freightquote_com

 

}

 

}

 

}

 

 

 

Its really slowing down the website response. could you recommend any better way to do it.

 

 

Thanks

 

 

Shohab
  • I have fixed signin.aspx page but that doe snot solve my problem. Can anyone take a look at the rule and recommend which can boost the performance.

     

     

    Thanks

     

     

    Shohab
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Check out this post for an example of solving the same problem using "findclass" instead of "switch". Not sure if it will improve performance, but it's worth trying:

    http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&postid=14031&ptarget=14072 (Click here)

    Since you want to switch on the entire URI, instead of just the host & part of the URI, just replace these 2 lines:
    set req "[HTTP::host]/[getfield [HTTP::uri] "/" 2]"
    set redir [findclass $req $::TURL_List]
    with this one:
    set req "[HTTP::host]/[getfield  "/" 2]"
    set redir [findclass [HTTP::uri] $::myRedirects " "]

    HTH

    /deb