Forum Discussion
Daric_Smith
Nimbostratus
Jun 17, 2019HTTP redirect to full URL Path
We have a URL that we would like to redirect from a friendly name to a full path.
Example: taking http://application.bob.com and redirecting it to the back-end node's URL: http://back_end_node/application_path.
- Andy_McGrath
Cumulonimbus
Do you want a redirect, i.e. HTTP redirect sent back to client, or are you looking to rewrite the hostname and path on the F5 before forwarding traffic on to the backend servers?
Also you want to redirect/forward to add uri on, e.g. http://application.bob.com/app1 to http://back_end_node/application_path/app1
Redirect:
when HTTP_REQUEST { if {[getfield [HTTP::host] : 1] eq "application.bob.com"} { HTTP::redirect "http://back_end_node/application_path[HTTP::uri]" } }
Forward:
when HTTP_REQUEST { if {[getfield [HTTP::host] : 1] eq "application.bob.com"} { HTTP::header replace "Host" "back_end_node" HTTP::uri "/application_path[HTTP::uri]" } }
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