Forum Discussion
Ranvir_Floura_7
Nimbostratus
Jan 02, 2008iRule and trailing slash issue
Folks,
Got a issue that is bugging me. Here is the iRule that I am working off and it works for the most part, but i have to put the trailing "/" for it to work. I need to have it working ...
hoolio
Cirrostratus
Jan 02, 2008With that rule, if the URI was just /dev3, the URI sent to the web app would be null. That's not valid in HTTP. You could use this to check the URI:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/dev3" } {
Set the pool to dev3 for all requests starting with /dev3
pool dev3
Remove /dev3 from the URI
set uri [string range [HTTP::uri] 5 end]
Check if updated URI has a length
if {$uri}{
Updated URI has a length, so set the request to the updated URI
HTTP::uri $uri
} else {
Updated URI was empty, so set the URI to /
HTTP::uri /
}
}
}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
