Forum Discussion
Carl_Gottlieb_1
Nimbostratus
Apr 16, 2007Modify HTTP resonse redirect
Hi,
I have a webserver generating a 302 redirect to the client, sending them to a location of:
https://www.domain.com/uristuffhere&URI=http://www.domain.com&somemorestuff&URI=http=http://www.domain.com
I need to modify this response to change the strings in the Location to be https if they are not already. In effect, an iRule to find the string of URI=, look at the next 5 characters, if they are http: change them to https:
I'd like this function to apply to both instances of the URI= in the HTTP response Location header.
Out of interest, I need this iRule to workaround an issue with a GetAccess server behind an SSL terminating BigIP version 9.2.4. The requests to the GetAccess server are in HTTPS but the redirects it generates contain http references in the Location as described above.
Could anyone point me in the right direction to accomplish this?
Many thanks,
Carl
- Carl_Gottlieb_1
Nimbostratus
Hi Joe,when HTTP_RESPONSE { if { [HTTP::status] eq 302 } { HTTP::header replace "Location" [string map {"http://" "https://"} [HTTP::header "Location"]] } }
- Great, glad to hear things are up and running now!
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