1. Home
  2. Docs
  3. WordPress
  4. Setup
  5. Switch Naked Domain to www Domain

Switch Naked Domain to www Domain

So, you were originally using yourdomain.com for your WordPress site, and you would like to switch to www.yourdomain.com. Simply follow these steps.

Remove Domain from QUIC.cloud

If yourdomain.com (without the www is already added to QUIC.cloud, you will need to remove it first. If not, you can skip this step.

Change the Domain in WordPress Admin

To switch your WordPress site from yourdomain.com to www.yourdomain.com, follow these steps:

  1. Log into your WordPress Admin
  2. Navigate to Settings > General
  3. Set both WordPress Address (URL) and Site Address (URL to https://www.yourdomain.com.
  4. Click the Save Changes button.

Add www Domain to QUIC.cloud

  1. Navigate to LiteSpeed Cache > General and request a new Domain Key by pressing the Refresh Domain Key button. (If this is your first time generating a domain key, the button will say Request Domain Key.)
  2. Press the Link to QUIC.cloud button.


What if my WordPress still does not force redirect to www ?

If you’ve properly executed the previous steps, there may be a cache plugin such has LiteSpeed Cache still caching the old data. Please navigate to LiteSpeed Cache > Toolbox > Purge and press the Purge All Cache button.

Do I need to add anything to .htaccess?

It is not required, but it is recommended to do an .htaccess-level redirect to www. Add this code to the top of your htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

Don’t forget to replace yourdomain.com with your actual domain.

Should I replace hard-coded URL’s in my database which point to the non-www version?

Technically, if the .htaccess redirect above is set up correctly, then any hard-coded yourdomain.com URLs will be redirected to www.yourdomain.com.

If you’d like to avoid the extra step of redirection, you can search and replace the values in your database with a tool such as this one. Please use extreme caution when changing database values, as you could easily break your site. If you must do this, we recommend getting help from a system admin or developer.

Was this article helpful to you? Yes 3 No

How can we help?