Forum Discussion

Michael_61106's avatar
Michael_61106
Icon for Nimbostratus rankNimbostratus
Mar 14, 2013

Redirect to New Page but Pass Query String Parameters

Hi !

 

Is somebody able to help me on this request please.

 

We want to redirect to a new path on the website but also pass the requested parameters (session Paramater which changes) on the redirect.

 

 

It should look like this:

 

Request https://mysite.test.com/?login=12345678901234567890

 

redirect to

 

https://mysite.test.com/new1/new2/?login=12345678901234567890

 

 

Any quick help is very welcome. Thanks

 

 

2 Replies

  • e.g.

    [root@ve10:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
       if { [HTTP::path] eq "/" } {
          HTTP::redirect "https://[HTTP::host][string map {/? /new1/new2?} [HTTP::uri]]"
       }
    }
    }
    
    [root@ve10:Active] config  curl -Ik https://mysite.test.com/?login=12345678901234567890
    HTTP/1.0 302 Found
    Location: https://mysite.test.com/new1/new2?login=12345678901234567890
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0