Forum Discussion
jmartinez_44554
Nimbostratus
Aug 03, 2015How to parse a guid from a uri to using in a redirection
I need to keep the guid of a uri and redirect to a new uri using the guid
Whats the best way to accomplish this.
original uri:
en/server/GUID-876D26ED-3B49-41EB-8470-78D3F60F1360addHistory=...
Vernon_97235
Aug 03, 2015Historic F5 Account
when HTTP_REQEUST {
set guid [findstr [HTTP::query] "docid=" 6 &]
if { $guid ne "" } {
HTTP::redirect "http://host.example.com/en/server/$guid"
}
}
Naturally you should substitute an appropriate name for "host.example.com". This will not redirect if the docid query parameter is not found, and it makes no effort to validate the GUID.
jmartinez_44554
Nimbostratus
Aug 03, 2015Thanks for the reply. I'm getting this error when trying to save the rule.
01070151:3: Rule [/Common/livelibrarytest_redirects] error: /Common/livelibrarytest_redirects:1: error: [unknown event (HTTP_REQEUST)][when HTTP_REQEUST {
set guid [findstr [HTTP::query] "docid=" 6 &]
if { $guid ne "" } {
HTTP::redirect "http://host.example.com/en/server/$guid"
}
}]
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