WPCloud Deploy Documentation

Force The Use of WWW On A Website

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:

  • “www” stores cookies for the domain and all subdomains.  Without www, separate cookies are stored for each subdomain.  So, for large sites with many requests going between subdomains it might be a tab bit faster when using “www”
  • An existing site already uses “www” and simply wants to continue doing so to preserve SEO rankings & links

To force the use of WWW, just update your WordPress records on the WordPress settings screen.

  • Go to SETTINGS->GENERAL
  • Add the ‘www’ in the WordPress Address and Site Address fields.

You can confirm that the change has been made by going to the permalinks screen:

  • Go to SETTINGS->Permlinks
  • Each permalink option should show the “www” in it.

Click the SAVE CHANGES button to update your permalinks.

Moving between HTTP and HTTPS

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’.

Search and Replace

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:

  • Search for “http://mydomain.com” and replace with “http://www.mydomain.com” (or “https://www.mydomain.com” if using ssl)
  • Search for “https://mydomain.com” and replace with “https://www.mydomain.com”

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 use the search and replace tool in UPDRAFT PLUS (which is our backup plugin).  There are other tools that can be used to do this as well.

Other Notes

Don’t forget to set up your CNAME for the “www” prefix in your dns if it’s not already present!

Share: