Forum Discussion
jony23
Nimbostratus
Sep 12, 2018Need some help with a redirect
I need to do the folowing 301 redirects:
from
to
and
from
to
was trying with [HTTP::query [HTTP::uri]] but wasn't capable to achieve that.
If anyone can help me, please.
t...
Stanislas_Piro2
Cumulonimbus
Sep 12, 2018you can try this:
when HTTP_REQUEST {
if {[HTTP::host] equals "www.host.com" && [HTTP::path] equals "/path1/path2.jsp"} {
HTTP::respond 301 Location /path3/[URI::query [HTTP::uri] query1]/[URI::query [HTTP::uri] query2][expr {[set var1 [URI::query [HTTP::uri] var1]] ne "" ? "/?var1=${var1}" : "" }]
}
}
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