Forum Discussion
[HTTP::uri] in browser URL
Does anyone know how the first condition can remain true until the URL IN THE BROWSER changes, making it false?
when HTTP_REQUEST {
if { ([string tolower [HTTP::uri]] contains "xyz") } {
HTTP::respond 301 Location https://[HTTP::host][HTTP::uri]
/ Currently all the request URLs calls from the page get redirected to "http" because they are considered an independent/
// URI request.
/ Goal is to have all request URLs calls from the page to remain https because the URI in the browser remains true. /
} else {
HTTP::respond 301 Location http://[HTTP::host][HTTP::uri]
}
}
Any direction is fully appreciated.
Regards,
TRX
5 Replies
- hoolio
Cirrostratus
Hi Trx, - Sorry for not being clear. Here is an example.
- NOTE: The prompts occur before the site is redirect to "login.qad.com...".
- hoolio
Cirrostratus
As a bit of a guess, can you try this?when HTTP_REQUEST { if { ([string tolower [HTTP::uri]] contains "/template.login") or ([string tolower [HTTP::header Referer]] contains "/template.login") } { Do nothing. Let traffic go through because these need to go over SSL return } else { else re-route traffic back to http from https HTTP::respond 301 Location http://[HTTP::host][HTTP::uri] return } }
- Thanks.
The solution I went with was just redirecting back to http after the credentials URL post has been sent to the
server. I did that by setting a flag to 0 and after the post URL was sent the flag is set to 1. Next request if the
flag is set to 1, then route back to http.
Regards,
TRX
Recent Discussions
Related Content
* 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