I usually use non-www URLs for simplicity and having shorter URLs. So, I often redirect all requests to www to their non-www versions. This snippet redirects all requests to www.example.com to example.com. It’s generic, works with all domains and doesn’t require you to write the domain name….
.htaccess redirect www to non-www
Full Disclosure: This webpage may contain affiliate links, in which the website owner would receive a commission for purchases made. This does not affect your purchase cost.