Forum Discussion
iaine
Nacreous
Hi
If I've read your post correctly, you want to change the HTTP Host header and also remove the leading /abc from the URI. If so, something like this would do it...
when HTTP_REQUEST {
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"
}
}
In your Nginx snippet, you are also returning a 404 if you browse to root (/) - do you want to have this functionality as well?
Mayank
Jul 16, 2019Nimbostratus
Correct. So above rule would remove just "/abc" context path from URL but leave the application specific context path (/login)?
e.g. https://example.com.au/abc/login - > https://abc.com.au/login
Also, I don't want to return the default page if anyone browse to root (/).
Thank you.