I- Rule is a power full code which modify the http header and redirect the http request to any way you want.
One of the common use is to transfer a http request to https based connection for security or www.x.com to https://x.com. I am attaching the sample code for http transfers.
rule 1
when HTTP_REQUEST {
One of the common use is to transfer a http request to https based connection for security or www.x.com to https://x.com. I am attaching the sample code for http transfers.
rule 1
rule redirect_HTTPS
when HTTP_REQUEST {
if { [TCP::local_port] == 80 }{
HTTP::redirect https://[getfield [HTTP::host] ":" 1][string tolower [HTTP::uri]]
}
}
rule 2
when HTTP_REQUEST {
if { [HTTP::host] contains "www.x.com"} {
HTTP::redirect https://x.com[HTTP::uri] }
}