Forum Discussion
How do i append to a url
I have an application that I am load balancing on my LTM
Currently in production the application has a windows based ssl load balancing server.
When a user accesses the service www.xxx.yyy.zzz they are redirected to https://www.xxx.yyy.zzz/directory/file
I have established the SSL redirection effectively, so the http to https to translation is working. What I need to determine is how to append the /directory/file to the url
There are applications on this web server that need to be able resolve http://www.xxx.yyy.zzz/activity on port 80 without being redirected to https, so I will need to exclude certain url's from the http to https redirection.
I am a brand new to this kind of work and would appreciate any assistance you can provide.
There are many ways of achieving it. The optimal solution will vary, depending on how many URLs (actually HTTP paths) you need to exclude from the HTTP to HTTPS redirection.
- If there's 1-3 exclusions, I would use IF/ELSEIF conditional statements
- If there are more than 3 exclusions, I would use SWITCH conditional statement
- If there are more than 25 exclusions, I would use IF conditional statement to compare against a list of entries in a data-group.
I'm aware of one exclusion, and I would use the following solution
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] eq "www.xxx.yyy.zzz") && not([string tolower [HTTP::path]] eq "/activity") }{ HTTP::respond 301 Location "https://www.xxx.yyy.zzz/directory/file" Connection Close } }
- Hannes_Rapp_162Nacreous
There are many ways of achieving it. The optimal solution will vary, depending on how many URLs (actually HTTP paths) you need to exclude from the HTTP to HTTPS redirection.
- If there's 1-3 exclusions, I would use IF/ELSEIF conditional statements
- If there are more than 3 exclusions, I would use SWITCH conditional statement
- If there are more than 25 exclusions, I would use IF conditional statement to compare against a list of entries in a data-group.
I'm aware of one exclusion, and I would use the following solution
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] eq "www.xxx.yyy.zzz") && not([string tolower [HTTP::path]] eq "/activity") }{ HTTP::respond 301 Location "https://www.xxx.yyy.zzz/directory/file" Connection Close } }
- Hannes_Rapp_162NacreousThe following part between quote marks can be removed if 'www.xxx.yyy.zzz' is the only Host served via this Virtual Server. ''([string tolower [HTTP::host]] eq "www.xxx.yyy.zzz") && ''
- Hannes_RappNimbostratus
There are many ways of achieving it. The optimal solution will vary, depending on how many URLs (actually HTTP paths) you need to exclude from the HTTP to HTTPS redirection.
- If there's 1-3 exclusions, I would use IF/ELSEIF conditional statements
- If there are more than 3 exclusions, I would use SWITCH conditional statement
- If there are more than 25 exclusions, I would use IF conditional statement to compare against a list of entries in a data-group.
I'm aware of one exclusion, and I would use the following solution
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] eq "www.xxx.yyy.zzz") && not([string tolower [HTTP::path]] eq "/activity") }{ HTTP::respond 301 Location "https://www.xxx.yyy.zzz/directory/file" Connection Close } }
- Hannes_RappNimbostratusThe following part between quote marks can be removed if 'www.xxx.yyy.zzz' is the only Host served via this Virtual Server. ''([string tolower [HTTP::host]] eq "www.xxx.yyy.zzz") && ''
- Stanislas_Piro2Cumulonimbus
Hi Hannes,
I think
may be replaced by([string tolower [HTTP::path]] eq "/activity")
([string tolower [HTTP::path]] starts_with "/activity")
And if Application is case sensitive, you can remove
action.string tolower
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