Forum Discussion

Chad_Emerson_85's avatar
Chad_Emerson_85
Icon for Nimbostratus rankNimbostratus
May 12, 2006

Alter uri

Hey guys, I want to require https on my site by altering the http request with a rule to make it https. I have the ssl acc. feature on my box so I am trying to get it working. The only problem with the redirect is that I would need to keep their request intact due to book marks links ect... I saw an earlier example where the request was altered using something like the rule below, however I just need to make it https and retain the rest of the request. Maybe I'm making this more complicated than it needs to be but I havent found anything in the forum so far to help. Any ideas would be greatly appreciated.

 

 

when HTTP_REQUEST {

 

if { not ( [HTTP::uri] ends_with "/" ) } {

 

set newURI "[HTTP::uri]/index.html"

 

} else {

 

set newURI "[HTTP::uri]index.html"

 

}

 

HTTP::uri $newURI

 

}

 

 

Thanks and Have a great weekend!

 

 

  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    If you want to redirect all port 80 traffic to https, create a virtual on port 80 and apply this rule:

     

     

    http://devcentral.f5.com/Wiki/default.aspx/iRules/HTTPtoHTTPSredirect.html