Forum Discussion
Nams_119859
Apr 04, 2013Nimbostratus
when HTTP_REQUEST {
if { [HTTP::host] eq "xservicesdev.abc.com" and \
[matchclass [HTTP::uri] starts_with $::xservicesuri] and \
[HTTP::header exists Authorization] and \
[HTTP::header exists Version] } {
HTTP::redirect "http://[HTTP::host]/[HTTP::header Version][HTTP::uri]"
}
}
Thank you. With your help I was able to create the above iRule. This line - [matchclass [HTTP::uri] starts_with $::xservicesuri] checks if the uri starts with some specific service domains (xservicesuri is a list of those names) , this is instead of checking every uri, as we have too many. But this will also require change to the iRule everytime I have new domains. In order to avoid this I would like to check for the uri to "not start with" a version, so something like - not [matchclass [HTTP::uri] starts_with [HTTP::header Version]] but that didnt work. I tried both below:
not [matchclass [HTTP::uri] starts_with $::xservicesuri]
[matchclass [HTTP::uri] not starts_with $::xservicesuri]
Would appreciate any suggestions?
Thank you.