Forum Discussion
set TOKEN [getfield [HTTP::uri]
- Sep 01, 2023
F5workuserguy I'm not understanding the tinyURL piece because I was under the impression that the tinyURL service is what mapped to your URL for you and then you receive the full intended request. Can you provide an example of what each request would look like when it arrives to your F5 so we can formulate an iRule that will handle the request? For now you might try the following and see if that works for your purposes. I removed you creation of the HOST variable because you were not using it so it isn't necessary.
when HTTP_REQUEST priority 500 { if { [HTTP::uri] contains "/?r=" } { set TOKEN [getfield [HTTP::uri] "/?r=" 2] HTTP::respond 302 Location "https://www2.google.com/gui/reloan/getstarted?code=${TOKEN}" Connection Close } else { set TOKEN [getfield [HTTP::uri] "/" 2] HTTP::respond 302 Location "https://www1.google.com/ShortUrlLanding/?lmco=${TOKEN}" Connection Close } }
they are still going to have both rolling in that need to get redirected. I was hoping to get something for catching "/?r=" first, then the default "/" for the rest.
F5workuserguy I'm not understanding the tinyURL piece because I was under the impression that the tinyURL service is what mapped to your URL for you and then you receive the full intended request. Can you provide an example of what each request would look like when it arrives to your F5 so we can formulate an iRule that will handle the request? For now you might try the following and see if that works for your purposes. I removed you creation of the HOST variable because you were not using it so it isn't necessary.
when HTTP_REQUEST priority 500 {
if { [HTTP::uri] contains "/?r=" } {
set TOKEN [getfield [HTTP::uri] "/?r=" 2]
HTTP::respond 302 Location "https://www2.google.com/gui/reloan/getstarted?code=${TOKEN}" Connection Close
} else {
set TOKEN [getfield [HTTP::uri] "/" 2]
HTTP::respond 302 Location "https://www1.google.com/ShortUrlLanding/?lmco=${TOKEN}" Connection Close
}
}
- F5workuserguySep 01, 2023Altostratus
- F5workuserguySep 01, 2023Altostratus
update, I changed
contains to starts_with
Recent Discussions
Related Content
* 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