Forum Discussion
BPRIDE
Nimbostratus
May 03, 2016irule question
I have a HTTPS VIP configured on F5. Looking for iRule
https://f5.com/abc/Pages/default.aspx should redirect to https://f5.com/123/abc/Pages/default.aspx
https://f5.com/abc/* should redirect to...
Yann_Desmarest
Cirrus
May 04, 2016Optimized version :
when HTTP_REQUEST {
set path [HTTP::path]
if { $path equals "/abc/Pages/default.aspx" }{
HTTP::redirect https://[HTTP::host]/123/abc/Pages/default.aspx
alternatively you can use HTTP::respond 302 Location "/123/abc/Pages/default.aspx"
} elseif { $path starts_with "/abc/" }{
HTTP::redirect "https://[HTTP::host]/123[HTTP::uri]"
}
}
super optimized version 🙂
when HTTP_REQUEST {
set path [HTTP::path]
if { $path starts_with "/abc/" }{
HTTP::redirect https://[HTTP::host]/123[HTTP::uri]
alternatively you can use HTTP::respond 302 Location "/123[HTTP::uri]"
}
}
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