Dave_21507
Aug 14, 2008Nimbostratus
redirect uri to https
Hello,
We have a .NET application hosted in IIS that has a bunch of static links to image files in http://host/images/file.jpg . What I'm looking to do is redirect (or rewrite?) img links on the pages from http://host/images/file.jpg to https://host/images/file.jpg - the purpose is so that IE users don't get the warning that some items are secure and others not.
Here's what I have so far:
when HTTP_REQUEST {
if { ( [HTTP::uri] starts_with "/images" ) }{
HTTP::redirect https://[HTTP::host][HTTP::uri]}
}
Any ideas? It isn't working as planned.
I also tried this approach (to no avail):
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"*images/" {
HTTP::respond 301 Location "https://[getfield [HTTP::host] : 1][HTTP::uri]"
}
}
}
Am I going in the right direction or should I take the approach of rewriting img links?
Thanks!