Forum Discussion
Brantly_Perry_1
Nimbostratus
Nov 12, 2008Need HTTP Redirect assistance
Hey everyone. Need assistance figuring out the best way to accomplish a redirect.
http://host.com/uri
needs to redirect to
http://host.com/member?cid=uri ...
hoolio
Cirrostratus
Nov 12, 2008Hi there,
Do you want to redirect the client (so the browser address bar shows the update) or do you want to rewrite the URI and send the request to the pool?
I'm not sure under what circumstances you want to rewrite or redirect to /member?cid=uri, but here are two methods:
Redirect
HTTP::redirect "http://[HTTP::host]/member?cid=[HTTP::uri]
Rewrite URI
HTTP::uri "/member?cid=[HTTP::uri]"
Also, I think you'd want to replace HTTP::path with HTTP::uri for this line in your sample above:
/bp { HTTP::path "/member?cid=bp" }
HTTP::path does not include the query string. So I would think you'd run into a problem using HTTP::path to set a path that includes a query string if the original request already had a query string.
Original URI: /test/file.ext?param1=param2
Command: HTTP::path /member?cid=bp
Resulting URI?? /member?cid=bp?param1=param2
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
