Forum Discussion
DenisG_22372
Mar 25, 2012Historic F5 Account
HTTP rewriting problems, realtive path hell.
I need some rewriting rules so that if a user enters in just http://server it will redirect to http://server/application/application, with images coming from http://server/application and spellcheck f...
hoolio
Cirrostratus
Mar 25, 2012Hi Denis,
Can you try this version with debug logging added? If it doesn't work, can you reply with the anonymized logs from /var/log/ltm?
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]"
}
}
}
}
Thanks, Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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