Remove www. from all types of requests

Hi, thank you for the reply. After much diging around and trial n error, I came up with this:
http-request add-header X-Host-Redirect yes if { hdr_beg(host) -i www. }
acl host_redirect hdr_cnt(X-Host-Redirect) eq 1
reqirep ^Host:\ www.(.*)$ Host:\ \1 if host_redirect
redirect code 301 scheme https if host_redirect