remove www. from host and redirect with 301 on haproxy
Posted on Thu 01 October 2015 in Web • 1 min read
If you have a lot of domains on single haproxy frontend and only want domains without www for SEO reasons, you can remove the www. with this configuration
# add header on every incoming request with www
http-request add-header X-Host-Redirect yes if { hdr_beg(host) -i www. }
# math header
acl host_redirect hdr_cnt …
Continue reading