Forum Discussion

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

HTTP page redirection

Hello,

 

 

I'm having problem with HTTP page redirection IRULE. I want to redirect page from http://xyz.com to https://xyz.com

 

 

 

I have written following IRULE but it's not working for me .

 

 

HTTP_REQUEST {

 

if { [HTTP::host] equals "http://xyz.com/"} {

 

HTTP::redirect "https://xyz.com"

 

}

 

}

1 Reply

  • Hi Ravi

    Try the following:

    
    when HTTP_REQUEST { 
       if { [HTTP::host] eq "xyz.com" } { HTTP::redirect https://[HTTP::host][HTTP::uri] }
    }

    or

    
    when HTTP_REQUEST { 
       if { [HTTP::host] eq "xyz.com" } { HTTP::redirect https://[HTTP::host] }
    }

    Click here for a wiki reference

    thanks,

    CB