Forum Discussion
funduval
Nimbostratus
Sep 08, 2022Simple redirect of host name only, keeping the paths and query params in the redirect the same
Hi I'm kind of surprised I haven't been able to find a simple answer for this. We need to redirect (also see requirements below): https://foo.bar.com/authorize/aaa/bbb/someFile.jsp?response_type=...
Kevin_Stewart
Employee
Sep 08, 2022The following should do the job:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/authorize/" } {
HTTP::redirect "https://xxx.baz.com[HTTP::uri]"
}
}
[HTTP::uri] captures the entire URI path, ex.
/authorize/aaa/bbb/someFile.jsp?response_type=abc&client_id=def&scope=ghi&redirect_uri=jkl
HTTP::path] captures the URI without the querystring, ex.
/authorize/aaa/bbb/someFile.jsp
[HTTP::query] captures just the querystring, ex.
response_type=abc&client_id=def&scope=ghi&redirect_uri=jklHelp guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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