Forum Discussion
crocketv_18020
Nimbostratus
Feb 16, 2009Redirect and preserve HTTP referrer
Hello.. need some help with the following. You may see this question in a different thread but I was asked to post as a seperate question. thanks.
As prelude to upcoming installation I'm being asked to verify this as it looks like a requirement of the application mechanics. The following is really a two part question 1) verify iRule functionallity 2) the question regarding http REFERRER
Need to do a HTTP to HTTPS Redirect and append "/xlWebApp/" to the URL.
- Client incoming request = HTTP://123.123.org
- F5 will redirect these requests to http"S"://123.123.org/xlWebApp/
A coleuge has suggested the following iRule to do this
when HTTP_REQUEST {
if {[HTTP::host] contains "123.123.org" } {
HTTP::redirect "https://123.123.org/xlWebApp/"
The second part of the question is to ensure that the original HTTP REFERRER value is preserved and does not change.
Thanks much for your help!
1 Reply
- hoolio
Cirrostratus
Sorry... I thought you were asking a new question that wasn't related to the original post. To redirect requests from HTTP to HTTPS you can use a rule like this on the HTTP VIP:when HTTP_REQUEST { Redirect all requests to https://123.123.org/xlWebApp/ HTTP::redirect "https://123.123.org/xlWebApp/" }
The above example will redirect all HTTP requests to the HTTPS URL, https://123.123.org/xlWebApp/.
As far as the Referer header, I'm pretty sure the browser will set the Referer header value to the URI of the request which generated the redirect. So if the first request is to http://www.example.com/first_page.html and the client is redirected to https://www.example.com/second_page.html, the Referer in the request to https://www.example.com/second_page.html will be http://www.example.com/first_page.html. I don't think there is a way to modify what the client sets the Referer header to.
Aaron
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