Forum Discussion
uni
Altocumulus
Jul 12, 2006Rewrite redirects to issuing host
I have an https virtual which forwards to an http server, hence I need to rewrite redirects when they point back to the issuing server.
"rewrite all" does not work because the server may issue a r...
uni
Altocumulus
Jul 13, 2006Good point. I must have been distracted by the phone.
What I should have posted is this:
when HTTP_REQUEST {
set host [HTTP::host];
log LOCAL0.debug "URI=$host";
}
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "3" } {
set location [HTTP::header "Location"];
if { $location starts_with "http://" } {
set temp [substr $location 7];
if { $host equals [substr $temp 0 "/"] }{
HTTP::header replace "Location" "https://$temp";
}
}
}
}Will [substr $temp 0 "/"] return the trailing "/"? If so, can anyone suggest an efficient way of dropping it?
Sorry to ask such simple, testable, questions. Unfortunately I don't have a test environment and will only have a short testing window when I put this in production.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
