Forum Discussion
Jay_Ward_231434
Nimbostratus
Jun 07, 2016Passthough path and query/parameters, but redirect URL without path or query/parameters.
Hello,
I am looking for some iRule help. I need to be able to passthrough a URL to backend servers that has any path or parameters (this might be default, not sure). For example, https://myexample.com/path/go would be get passed through to backend servers.
If the request comes in without a path/query/paramters, for example it will get redirected to a different url, for example https://redirecturl.com
Thanks!
2 Replies
- Vijay_E
Cirrus
Try this (untested):
when CLIENT_ACCEPTED { set DEFAULT_POOL [LB::server pool] } when HTTP_REQUEST { if { ( [string tolower [HTTP::host]] eq "myexample.com")} { if { not ([HTTP::uri] eq "/") } { HTTP::respond 301 Location "https://redirecturl.com/" } else { pool $DEFAULT_POOL } } } Hi,
Here an irule example :
when HTTP_REQUEST { if { [HTTP::uri] eq "/" and [HTTP::query] eq "" } { HTTP::respond 301 Location "https://redirecturl.com/" } }
Help 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