Forum Discussion
HTTP rewriting problems, realtive path hell.
unfortunately every call coming in is getting the /application appended so the spell check doesn't work. Logic is not working today.
I thought I would just use an if / else, but the spellcheck is killing that option. Here is what I have so far:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set path [HTTP::path]
if { ( $host ne "server.domain.com" ) } {
HTTP::redirect "
server.domain.com $path"
}
if { ([HTTP::uri] equals "/" or [HTTP::uri] equals "/application" )} {
HTTP::uri /application/application
}
this is the broken bits
if {([HTTP::uri] starts_with "/jspellhtml2k4")} {
HTTP::uri /spellcheck[HTTP::uri]
}
if { !([HTTP::uri] starts_with "/application")} {
HTTP::uri /application[HTTP::uri]
}
}
- hoolio
Cirrostratus
Hi Denis,when HTTP_REQUEST { if { [string tolower [HTTP::host]] ne "server.domain.com" } { HTTP::redirect "http://server.domain.com[HTTP::uri]" log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to http://server.domain.com[HTTP::uri]" } else { Check requested path switch -glob [HTTP::uri] { "/" - "/application" { HTTP::uri /application/application log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting [HTTP::uri] to /application/application" } "/jspellhtml2k4*" { HTTP::uri /spellcheck[HTTP::uri] log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting [HTTP::uri] to /spellcheck[HTTP::uri]" } "/application*" { Do nothing log local0. "[IP::client_addr]:[TCP::client_port]: Preserving [HTTP::uri]" } default { HTTP::uri /application[HTTP::uri] log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting [HTTP::uri] to /application[HTTP::uri]" } } } }
- DenisG_22372Historic F5 AccountA million thanks, I see that my newbiness in not see the wildcard * needed after the application* and the spellcheck*
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