Forum Discussion

tarma_58716's avatar
tarma_58716
Icon for Nimbostratus rankNimbostratus
Jun 12, 2011

split port url in the https class redirection

Hi i've a httpclass wich redirect the client to a new URL:

 

 

profile httpclass localhost_redirect {

 

defaults from httpclass

 

pool none

 

redirect "http://172.x.x.x:"2131"

 

}

 

 

The Vs has not a pool it just redirect the client to the new URL.

 

I would like to split the port number in to the browser.

 

 

Has anyone know how to write an irule allowing this.

 

 

I've tried to use this iRule but it doesn't work, the port still be displayed buy the Browser:

 

 

when HTTP_REQUEST {

 

if { [HTTP::header value Location] contains ":" } {

 

HTTP::header replace Location [lindex [split [HTTP::header value Location] ":"] 0]/

 

}

 

}

 

 

Thanks in advance for your help.

 

13 Replies

  • virtual bar80 {

     

    destination 172.28.17.88:80

     

    ip protocol 4

     

    rules myrule

     

    profiles {

     

    http {}

     

    tcp {}

     

    }

     

    }

     

    rule myrule {

     

    when HTTP_REQUEST {

     

    virtual bar1234

     

    HTTP::uri "new_uri"

     

    }

     

    }

     

     

    virtual bar1234 {

     

    snat automap

     

    pool foo

     

    destination 172.28.17.88:1234

     

    }

     

    pool foo {

     

    members 10.10.70.110:80 {}

     

    }

     

     

    is it correct?

     

    i've tested that but in the browser i haven't the URI displayed but i was correctly redirected to the URI.

     

     

    to send all the next requests to virtualbar1234/new_uri do i need to force the browser displaying the the correct URI.

     

     

    I know it's so confused.

     

    Thanks a lot for your help
  • the thing i want to do is when the user hit http://172.28.17.8 on port 80, he is redirected to http://172.28.17.8/new_uri on port 1234.

     

    i would like to have on the browser after the redirection http://172.28.17.8/new_uri so all the next requests will be sent from this page.
  • I think you should be able to just rewrite the URI for requests to / to /new_uri and configure the pool on port 1234. You shouldn't need two virtual servers for this.

     

     

    Aaron