lguerra07_54491
Mar 09, 2010Nimbostratus
HTTP to HTTPS 301 redirect with datagroups
I simply need to redirect from HTTP to HTTPS and get a 301 code. I was able to get this to work with the following if statement:
--------
when HTTP_REQUEST {
if { [HTTP::host] eq "www.domain.com" and [HTTP::uri] ends_with "/uri1/test.html" }{
HTTP::respond 301 Location "https://www.domain.com/uri1/test.html"
}
}-----------
The big question would be, how can I make this work with a datagroup? this is my datagroup so far:
------
class 301_redirect {
"www.domain.com https://www.domain.com/uri1/test.html"
"www.domain.com https://www.domain.com/uri2/test.html"
}------
any help is appreciated.
thanks.