Sometimes you want to force the use of WWW in front of your domain. There is generally very little difference on a site using a WWW prefix vs not using it. There are two reasons though why you might want to force it:
To force the use of WWW, just update your WordPress records on the WordPress settings screen.
You can confirm that the change has been made by going to the permalinks screen:
Click the SAVE CHANGES button to update your permalinks.
You may need to update your DNS pointers as well to create a WWW entry.
When you switch between HTTP and HTTPS (or vice-versa), we update the domain back to its default. So, you will need to make the change twice.
First, add the ‘www’ before turning on HTTPS. This allows us to get a certificate for both ‘www’ and non-www domains.
After HTTPS is turned on, go back and add ‘www’.
If you’re going from a “mydomain.com” to “www.mydomain.com” then you’ll want to use a WordPress search and replace tool to conduct two search & replaces on your database:
Do NOT search for just “mydomain.com” and replace with “www.mydomain.com”. If you do you might end up with entries such as “http://www.www.mydomain.com”.
We have a simple search and replace tool in the SITE detail screen. But for more sophisticated search & replace function we use the search and replace tool in UPDRAFT PLUS (which is our backup plugin). There are other 3rd party tools that can be used to do this as well.
Don’t forget to set up your CNAME for the “www” prefix in your DNS if it’s not already present!