Forum Discussion
JOBrien2019
Nimbostratus
Apr 15, 2019iRule using IP
I want to setup an iRule to redirect on an IP which has a swagger page. Here's what I have:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"**My ip address here**" {
if { [HTTP::uri] starts_with "swagger" } {HTTP::redirect "https://[HTTP::host]/"}
if { [HTTP::uri] starts_with "api" } {HTTP::redirect "https://[HTTP::host]/"}
}
}
}
By this guide it looks correct but it doesn't actually redirect a page.
1 Reply
- CharlesCS
Cirrus
A URI path always starts with a forward-slash, so change "swagger" to "/swagger" and "api" to "/api", and you should be all right.
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