Forum Discussion
johns
Employee
Mar 02, 2006iRule recognize blank space in URI?
Hi, I need to detect blank space in URI and either remove it or rewrite it:
www.mysite.com/some content/showme.html
to
www.mysite.com/some%20content/showme.html
...
johns
Employee
Mar 09, 2006Thank you, I was able to extract the URI b/w "GET" and " HTTP" (to remove the last space before HTTP) with:
when CLIENT_ACCEPTED {
TCP::collect 200
set ::uri 0
}
when CLIENT_DATA {
if { [regexp "/vMoD.+HTTP" [TCP::payload] match] } {
log local0. "match found: $match"
set ::uri [getfield $match " HTTP" 1]
log local0. $::uri
} else {
log local0. "no match"
}
}
I tried adding
when HTTP_REQUEST_DATA {
HTTP::redirect http://[HTTP::host]$::uri
}
I was looking for a simple way to test and see if I can substitue the URI with a new one, but obviously it does not. Do I need to figure out a way to replace it within the CLIENT_DATA event?
John
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
