Forum Discussion
Mayank
Jul 15, 2019Nimbostratus
F5 redirect context path to APACHE Web Server.
Hi there, I’m assisting one of my customer to integrate our software with F5. I was told that currently, F5 is configured using the Context Path (/abc) which redirect to my application’s...
iaine
Jul 18, 2019Nacreous
So I'm guessing your application is using absolute paths when sending a redirect rather than relative paths? If so, you can either remedy this using the HTTP profile or in code. To add to the code that you've currently got, it would look something like this
when HTTP_REQUEST {
if {[HTTP::uri] equals "/"} {
HTTP::respond 404 content "<HTML><BODY>404 Page Not Found</BODY></HTML>" noserver
return
}
if {[HTTP::host] contains "example.com.au" } {
if {[HTTP::uri] starts_with "/abc/" } {
HTTP::uri [string range [HTTP::uri] 4 end]
}
HTTP::header replace Host "abc.com.au"
}
}
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
HTTP::header replace Location [string map {"abc.com.au" "example.com.au"} [HTTP::header Location]]
}
}
There's good article here if you want to look at both options
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