Chris_Phillips
Nov 22, 2006Nimbostratus
HTTPtoHTTPSredirect example not working
Hi,
a fair few threads with titles like this, but don't seem to be asking my question here...
i'm trying to use that example code:
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
but it doesn't even make sense to me reading it. using an example of "http://example.com/index.php" the consitutent parts are:
1) HTTP::host = example.com
2) [getfield [HTTP::host] ":" 1] = example.com
3) HTTP::uri = http://example.com/index.php
so the HTTP::redirect line ends up looking like "https://example.comhttp://example.com/index.php" which is clearly not useful! presumably HTTP::uri is only meant to read "/index.php" ? That's certainly not what my copy of IE6 is saying...
No. Time Source Destination Protocol Info
85 1.506783 10.224.21.17 10.224.0.11 HTTP GET http://cms.national.ncrs.nhs.uk/testurl.php HTTP/1.0
Frame 85 (482 bytes on wire, 482 bytes captured)
Ethernet II, Src: DellPcba_d0:b7:2c (00:0d:56:d0:b7:2c), Dst: All-HSRP-routers_01 (00:00:0c:07:ac:01)
Internet Protocol, Src: 10.224.21.17 (10.224.21.17), Dst: 10.224.0.11 (10.224.0.11)
Transmission Control Protocol, Src Port: 3617 (3617), Dst Port: 8080 (8080), Seq: 0, Ack: 0, Len: 428
Hypertext Transfer Protocol
GET http://cms.national.ncrs.nhs.uk/testurl.php HTTP/1.0\r\n
Request Method: GET
Request URI: http://cms.national.ncrs.nhs.uk/testurl.php
Request Version: HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, [etc...]\r\n
Accept-Language: en-gb\r\n
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\r\n
Host: cms.national.ncrs.nhs.uk\r\n
Proxy-Connection: Keep-Alive\r\n
\r\n