Forum Discussion
Gill_32697
Sep 03, 2013Nimbostratus
redirects with get / post
We have created iRules to perform redirects on existing web services. All the rules appear to work correctly when performing a HTTPGet. However, when connecting from another application, the request ...
- Sep 04, 2013
It get redirected to a GET request
Gill_32697
Nimbostratus
Ok guys, so I have my original iRule and sample link from Richard. Now how in the heck to I merge these irule. Im not at the admin level need to script this, so I f you could help please.
Gill_32697
Sep 04, 2013Nimbostratus
::! This is my irule.
:
when HTTP_REQUEST {
if { ([string tolower [HTTP::host]]) contains "unitynet.mysite.com" } {
switch -glob -- [string tolower [HTTP::uri]] {
"*akcelerantws.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/Akcelerantws.asmx"
}
"*credispherewsv2.asmx*" {
HTTP::redirect "http://webservices.mysite.com/Unity/CrediSphereWSV2.asmx"
}
"*interfaceservice.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/InterfaceService.asmx"
}
::"*meridianlinkws.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity[HTTP::uri]"
}
"*unitysailws.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/UnitySAILWS.asmx"
}
"*unityweblet.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/UnityWeblet.asmx"
}
"*weblet.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/UnityWeblet.asmx"
}
}
}
}
=================================
::! This is from https://clouddocs.f5.com/api/irules/HTTP_POST_redirectNew118.html
:
when HTTP_REQUEST {
Check if request was a POST
if { [string tolower [HTTP::method]] eq "post" } {
Check if there is a Content-Length header
if { [HTTP::header exists "Content-Length"] } {
if { [HTTP::header "Content-Length"] > 1048000 }{
Content-Length over 1Mb so collect 1Mb
set content_length 1048000
} else {
Content-Length under 1Mb so collect actual length
set content_length [HTTP::header "Content-Length"]
}
} else {
Response did not have Content-Length header, so use default of 1Mb
set content_length 1048000
}
Don't collect content if Content-Length header value was 0
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
}
when HTTP_REQUEST_DATA {
set content "< script type=text/javascript language=javascript> \
function s(){ document.f.submit(); } \
"
HTTP::respond 200 content $content
switch -glob -- [string tolower [HTTP::uri]] {
"*akcelerantws.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/Akcelerantws.asmx"
}
"*credispherewsv2.asmx*" {
HTTP::redirect "http://webservices.mysite.com/Unity/CrediSphereWSV2.asmx"
}
"*interfaceservice.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/InterfaceService.asmx"
}
::"*meridianlinkws.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity[HTTP::uri]"
}
"*unitysailws.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/UnitySAILWS.asmx"
}
"*unityweblet.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/UnityWeblet.asmx"
}
"*weblet.asmx*" {
HTTP::redirect "https://webservices.mysite.com/Unity/UnityWeblet.asmx"
}
}
}
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