Forum Discussion

Ravi_110217's avatar
Ravi_110217
Icon for Nimbostratus rankNimbostratus
May 02, 2008

page redirection

Hello,

 

 

I wanted to redirect following webpage...

 

 

Redirect from

 

www.xyz.com.au to https://www.xyz.com.au

 

 

If you know IRULE , please let me know...

 

Thanks.

1 Reply

  • Here is a codeshare example for 9.x:

    HTTP To HTTPS Redirect 302

    http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPToHTTPSRedirect_302.html

    For 9.x, you can use a rule like this to redirect all requests to the VIP to https:

    
    when HTTP_REQUEST {
        Check if Host header value has a length
       if {[string length [HTTP::host]]}{
           Redirect to the requested host and URI (minus the port if specified)
          HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
       } else {
           Redirect to VIP's IP address
          HTTP::redirect https://[IP::local_addr][HTTP::uri]
       }
    }

    For 4.x, you can check your post in that forum (Click here).

    Also, please post a single question in the appropriate forum. Posting the same question across multiple forums means you're likely to get the same answer from multiple people. And as nmenant pointed out, this question has been asked and answered fairly often. You'd find several working examples from a quick search of the relevant 4.x or 9.x forum.

    Thanks,

    Aaron