Forum Discussion
greenasp_41938
Nimbostratus
Sep 08, 2009remove port number and redirect to https
I am trying to remove a port number and redirect to https:
Current Url: http://affiliates.abc.com:1003/affiliateimages/picture.gif
I need it to redirect to https://affilaites.abc.com/affiliateimages/picture.gif (picture.gif is a changing variable)
I setup a vs for vs_affiliate_redirect_1003 assigned to port 1003;
However, I can't get the irule to work.(I am sure I am not setting it up right)
when HTTP_REQUEST { if { [HTTP::host] eq "affiliate.abc.com:1003"} {
HTTP::redirect "https://affiliate.abc.com"
}
}
- The_Bhattman
Nimbostratus
Hi,when HTTP_REQUEST { if {[HTTP::host] eq "affiliate.abc.com" { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
- hoolio
Cirrostratus
Is there any hosts and/or URIs you want to serve on the port 1003 VS? If not, you could redirect every request to a hardcoded hostname and the original URI:when HTTP_REQUEST { Redirect client to hardcoded host and preserve the original URI HTTP::redirect "https://affiliate.abc.com[HTTP::uri]" }
when HTTP_REQUEST { Check if Host contains a colon if {[HTTP::host] contains ":"}{ Redirect client to hardcoded host and preserve the original URI HTTP::redirect "https://affiliate.abc.com[HTTP::uri]" } }
when HTTP_REQUEST { Check if Host contains a colon if {[HTTP::host] contains ":"}{ Redirect client to requested host minus the port and preserve the original URI HTTP::redirect "https://[getfield [HTTP::host] ":" 1][HTTP::uri]" } }
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