Forum Discussion
Kevin_Stewart
Oct 01, 2015Employee
etc. I'm going to think about this a bit more. I thought it would be a simple redirect.
It was before you mentioned images and css... 😉
What I think you're basically saying is that you only want to redirect if the URL isn't for images or css. And for that you have to know WHAT constitutes one of these objects. If the URLs for images and styles always end with an image or .css extension, then it should be pretty straight forward.
If the URI doesn't end with .png or .jpg or .gif or .css and doesn't start with /home.aspx, redirect.
when HTTP_REQUEST {
if { not ( [class match [string tolower [HTTP::uri]] ends_with ext-dg] ) and not ( [string tolower [HTTP::uri]] starts_with "/home.aspx" ) } {
HTTP::redirect "http://[HTTP::host]/home.aspx"
}
}
where ext-dg is a string-based datagroup that contains all of the extensions you want to not redirect.
root@(bigip116)(cfg-sync Standalone)(Active)(/Common)(tmos) list ltm data-group internal ext-dg
ltm data-group internal ext-dg {
records {
.css { }
.gif { }
.jpg { }
.png { }
}
type string
}