Need workaround for 10.x Caching issue with HTTP::uri updates
The final 3 in the irule involve updating the HTTP::uri and connecting to the pool web-pool with the correct formatted string that the php code is expecting. Currently we are experiencing the cached value of HTTP::uri being sent though to the web-pool.
We are in the process of moving to 10.2.4 and have this one last irule that needs to be adjusted for the caching issues on the 10.X platform.
Any suggestion on how I should rewrite or restructure this irule?
when HTTP_REQUEST {
if { [HTTP::host] eq "hostname" } {
check for global redirects first
set gohere [class match -value [string tolower [HTTP::uri]] equals global_redirect_urls]
if { $gohere ne "" } {
HTTP::redirect $gohere
}
unset gohere
set path [string tolower [HTTP::path]]
if {$path ends_with "/" and $path ne "/"} {
set path [string range $path 0 end-1]
}
set query [HTTP::query]
if {$path ends_with "/" and $query contains "member"} {
HTTP::redirect "http://[HTTP::host]/explore/?$query"
}
switch -glob $path {
"/app*" -
"/account*" -
"/groupmanager*" -
"/login*" -
"/signup*"
{
send to application servers with same path
HTTP::redirect "http://manage.[HTTP::host]$path?$query"
}
"/press*"
{
cleanup the press URI and send to wordpress server
HTTP::redirect "http://press.hostname.net/press/[string range [HTTP::uri] 7 end]"
}
"/blog*"
{
cleanup the press URI and send to wordpress server
HTTP::redirect "http://blog.hostname.net/[string range [HTTP::uri] 5 end]"
}
"/directory*"
{
pool app-pool
}
"/favicon.ico" -
"/sitemap.xml" -
"/index.php" -
"/"
{
pool web-pool
}
"/search*"
{
apply filter for search page and redirect with query string for Google CSE
HTTP::uri "/index.php?page=search&$query"
}
"/forms*"
{
parse for second level and send as form name
set formname [string range [URI::path [HTTP::uri] 2 2] 0 end-1]
HTTP::uri "/index.php?page=forms&form=$formname"
pool web-pool
unset formname
}
default {
apply filter for page name and redirect to handle pages
set tempuri "/index.php?page=$path&$query"
log local0. "URI after: $tempuri"
HTTP::uri $tempuri
pool web-pool
}
}
unset path
}
}