Forum Discussion
Mike_Singer_599
Nimbostratus
Jan 11, 2012Removing server header from http to https redirect
We have been asked to remove this by a client based on a pentest. I can find referernces to the noserver option in other posts but not the complete irule that incorrpates that w/ the redirected comma...
Andrew_Vishnyak
Nimbostratus
Mar 28, 2007Found the same problem with PDF, XLS and Java Web Start (JNLP) files.
IE 6/7 fails to download; Firefox is fine.
The problem seems to go away if you force the HTTP version in the response status line to 1.0 for all app downloads:
when HTTP_RESPONSE {
if { [HTTP::header "Content-Type"] contains "application" } {
HTTP::version "1.0"
}
}
Seems like a hack, so I'm still looking for a proper solution. Anybody?
- Nov 28, 2019
Hi,
Can you try this?
when HTTP_REQUEST { if { ([HTTP::host] contains "syst3-my.test.co.uk") and ([string tolower [HTTP::path]] starts_with "/test/cs") } { if { not ([class match [IP::client_addr] equals private_net]) } { HTTP::redirect "https://syst3-my.testco.uk/test/home" } } }
HI Mate, thanks for your swift help really appreciate it.
wondering how do I match another URL path as well if I say host match syst3-my.test.co.uk and URL either starts with "/test/cs" or "/test12/cs"
thank you
- Nov 28, 2019
when HTTP_REQUEST { if { ([HTTP::host] contains "syst3-my.test.co.uk") and ([string tolower [HTTP::path]] starts_with "/test/cs" or [string tolower [HTTP::path]] starts_with "/test12/cs") } { if { not ([class match [IP::client_addr] equals private_net]) } { HTTP::redirect "https://syst3-my.testco.uk/test/home" } } }
If you want redirect for more path, you can use "switch" statement.