Forum Discussion
Tadeo_Picazo_37
Nimbostratus
Oct 12, 2018Modify uri request
Hi i am new on the F5, Do you know if there is a way to modify the uri and redirect to a new path, basically we would like to check if the URI does not contain like /test1/../ or /Test2/../ then add /newpage/Test1/../
we have been doing something like this
when HTTP_REQUEST { log local0. "incoming URI: [HTTP::uri]"
if { [HTTP::host] contains "VIP" } {
if { (!([string tolower [HTTP::uri]] contains "/test1/")) || (!([string tolower [HTTP::uri]] contains "/test2/")) } {
set newpath [HTTP::host]"/newpage/test1[HTTP::uri]"
log local0. "redirecting to https://$newpath"
HTTP::redirect "https://$newpath"
}
}
}
- Kevin_Stewart
Employee
It looks pretty close.
if { [HTTP::host] contains "VIP" } { if { (!([string tolower [HTTP::uri]] contains "/test1/") && !([string tolower [HTTP::uri]] contains "/test2/")) } { HTTP::redirect "https://[HTTP::host]"/newpage/test1[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