Forum Discussion
iRule for specific URL from HTTPS to HTTP
iRule to redirect HTTPS back to HTTP only for specific URL with wildcard after ? "/VideoPlayer.aspx?eventID=2443575804_2017011157&committeeID=2911"
I have a iRule to redirect HTTP to HTTPS when visiting a site that starts with "/LD" but I need an iRule to redirect only "VideoPlayer.aspx?*" back to HTTP. This is what I started with, but it breaks my HTTPS requirement to redirect my /LD directory.
Any assistance would be greatly appreciated!
HTTPS assigned when HTTP_REQUEST { if { [HTTP::uri] contains "VideoPlayer" && [HTTP::uri] contains ".aspx?" } HTTP::redirect "http://[HTTP::host]$uri" }
HTTP assigned when HTTP_REQUEST { if { ( [string tolower [HTTP::uri]] starts_with "/ld" ) } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
1 Reply
- crodriguezRet. Employee
How about something like what's below to start from for the HTTPS virtual server. You can use HTTP::path to extract just the path portion of the URI (without the query string).
when HTTP_REQUEST { if { [string tolower[HTTP::path]] ends_with "videoplayer.aspx" } { HTTP::redirect "http://[HTTP::host][HTTP::uri]" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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