Forum Discussion
LyonsG_85618
Jan 21, 2013Cirrostratus
I have managed to get the date check working and now 'expired' hosts get sent to a notfound page:
when HTTP_REQUEST {
set debug 1
set datecheck CLASS_DATE_CHECK
set today [clock format [clock seconds] -format {%Y%m%d} ]
set expiry_date [class match -value [string tolower [HTTP::uri]] starts_with $datecheck]
set uriexpired 0
if {($expiry_date < $today)} {
set uriexpired 1
}
if {($uriexpired equals "1") and ([HTTP::uri] equals [class match -name [string tolower [HTTP::uri]] starts_with $datecheck])} {
if {$debug > 0} {
log local0. "uri=[HTTP::uri] and Classmatch=[class match -name [string tolower [HTTP::uri]] starts_with $datecheck]"
}
HTTP::respond 302 noserver Location "http://www.test.com/notfound"
Still looking at the URI part though. My customer wants to publish a random string before the actual 'real' uri.
i.e. http://www.test.com/123456789/testsite1
I need to remove the /123456789 before passing to pool and then add it back in before responding to clients.
As the string will be randomly generated I cannot use a string replace.
I was looking at stream profile's too but not sure which option would work best?
Any thoughts?