Forum Discussion
Tyler_Jason_985
Nimbostratus
Aug 02, 2006Redirect HTTP to HTTPS Based upon URL
Hello all,
I am new to iRules, BigIP and the like so I apologize in advance.
I have a situation where I need to redirect HTTPs to HTTP when a url does not start with 'abc.xyz.com'. ...
Jim_Reilly_4704
Aug 15, 2006Historic F5 Account
Joe this is similar to the request above as it has to do with the rewrite all function modifying redirects to sites not hosted by the origin application.. Rewriting a 30x based on the host name in the location field. For example if the location contains abc.com then rewrite to HTTPS://host/uri. iRule 1st timer appreciate the patience. Thanks in advance.
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "3" & [HTTP::location] contains "abc.com/" } {
set location [HTTP::header "Location"];
log LOCAL0.debug "Location: $location (check for rewrites)";
if { $location starts_with "http://" } {
set temp [substr $location 7];
HTTP::header replace "Location" "https://$temp";
}
}
}
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