Redirect www to non www
My website is now accessible through two links:
I would like the site to be accessible only through website.com and that www.website.com will therefore refer to website.com.
I use haproxy for load balacing of my two web servers. ssl offloading is used upon arrival
I have visited a lot of sites but nowhere is there really a working answer, so maybe someone here knows the answer
dragoangel last edited by dragoangel
Cleantext HAproxy config:
acl www.somedomain.com var(txn.txnhost) -m str -i www.somedomain.com http-request redirect code 301 location https://somedomain.com%[url] if www.somedomain.com
Sample of how looks Frontend Actions Table Record (second line):
For better understanding better read https://cbonte.github.io/haproxy-dconv/ and use HAProxy 1.8.x version on pfSense wich package marked as: haproxy-devel
@dragoangel it works, nice! thank you so much
http-request redirect code 301 location https://somedomain.com%[url] if www.somedomain.com
Hey guys - and how it that reverse? I would like to have a redirect from domain.tld to www.domain.tld.
www.domain.tld is working fine - but domain.tld runs in the failure site of HAProxy
Thanks for helping!
dragoangel last edited by
@Overlord show your config, in pm if you want