craigvphillips_
Apr 06, 2017Nimbostratus
Tomcat context path URL
Simpe, just want to rewrite the url from http://example.bleh.com to http://example.bleh.com/example.
I am doing the following, it simply doesn't work and i can't get any logging to output so i'm just sitting here flying blind. I've searched and searched and everybody keeps using static examples, which is a bad practice.
when RULE_INIT {
set ::domain ".bleh.com"
}
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
if { [string tolower [HTTP::host]] contains $::domain }{
set subdomain [getfield [HTTP::host] $::domain 1]
if { not ($subdomain == "") }{
set context [getfield $subdomain "-" 1]
HTTP::uri "$context"
}
}
}
}