Forum Discussion
hooleylist
Cirrostratus
Oct 27, 2010Maybe something like this?
when HTTP_RESPONSE {
Check if server response is a redirect and contains the wp-admin pattern
if { [HTTP::header is_redirect] and \
[string match -nocase {*www.server.com/*/wp-admin*} [HTTP::header Location]]} {
Log original and updated values
log local0. "Original Location header value: [HTTP::header value Location],\
updated: [string map -nocase "http:// https://" [HTTP::header value Location]]"
Do the update, replacing http:// with https://
HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header value Location]]
}
}
Aaron