Hello everyone;
I’m trying to do a simple http https redirect for a VSA.
Before
looking to see
I found the code sample
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] “:” 1][HTTP::uri]
}
and created an iRule called HTTP_HTTPS_REDIRECT. I attached this iRule to the VSA
My ultimate end state is to add the this functionality to my URI parse rule
RULE NAME: D3_INT1_CMS_SECURE_REDIRECT
VERSION : 1.0
DESC : CMS (Documentum) Secure Redirects
when HTTP_REQUEST {
set uri [HTTP::uri]
Extract first element after slash in URIset
set target [getfield [HTTP::uri] “/” 2]
To perform redirect
Check if the field doesn’t contain a dot
Check if the uri doesn’t contain the field followed by a slash
Check if http request and redirect to https
if { [HTTP::uri] starts_with “/da/” } {
pool D3_INT1_CMS
}
elseif { [HTTP::uri] starts_with “/webtop/” } {
pool D3_INT1_CMS
}
elseif { [HTTP::uri] starts_with “/woh/” } {
pool D3_INT1_CMS
}
elseif { [HTTP::uri] starts_with “/wp/” } {
pool D3_INT1_CMS
}
elseif { not ( $target contains “.”) and not ([HTTP::uri] contains “${target}/”) } {
HTTP::redirect “https://[HTTP::host]/${target}/”
}
elseif { [HTTP::uri] starts_with “http://cms” } {
HTTP::redirect “https://cms-d3.tmi.telus.com”
}
else { pool D3_INT1_CONTENT
}
}
Thx
Steve