Redirecting www URLs to non-www
I haven't bothered to do this for websites for years, but recently I had to solve a problem with CiviCRM that required the URL to be a specific address. Apparently this configuration is also good for SEO. This article describes how to do it.
.htaccess
We will start by opening the .htaccess file for editing
- Browse to the root directory of your website.
- Open the .htaccess file and add the following content to the beginning of the file:
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ https://yourdomain.com/$1 [L,R=301]
Thanks for visiting,
Steven