Forum Discussion
Tristan_Rhodes
Altostratus
Mar 12, 2018How to redirect with a custom path and append original URI?
I can create an LTM policy that redirects to a new host and keeps the original URI:
iptv.mydomain.com {
actions {
0 {
http-reply
redirect
location https://www.mydomain.com[HTTP:URI]
}
}
conditions {
0 {
http-host
host
values { iptv.mydomain.com tv.mydomain.com }
}
}
description https://www.mydomain.com/tv/
ordinal 1
}
But what I'd like to do is append the original URI to a specified path:
location https://www.mydomain.com/tv[HTTP:URI]
However, BIGIP is saying that this is not a valid syntax. Is there a smart way to do this with LTM policies? Or do I need to create a custom iRule, and if so, how?
Thanks,
Tristan
You may try [HTTP::uri] syntax. https://devcentral.f5.com/wiki/iRules.HTTP__uri.ashx
- Stanislas_Piro2
Cumulonimbus
if you are working in version 12.0 or above, you have to add
before.tcl:
tcl:https://www.mydomain.com/tv[HTTP::uri]
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