How to Redirect a non-WWW to WWW URL in WordPress?

Redirect a non-WWW to WWW

How to Redirect a non-WWW to WWW URL in WordPress?

Oct 5, 2016 – 2 min read


Let’s say that we have installed WordPress and we want to redirect a non-WWW URL to WWW URL.


Here are the steps we may follow initially if we want to redirect a non-WWW to WWW URL:

  • Log in to the WordPress administration of your website.
  • From the main menu open “Settings” -> “General”.
  • Change the fields “WordPress Address (URL)” and “Site Address (URL)” from to (with https:// or http:// depending on if you use SSL or not).
  • Scroll down and press “Save Changes”.

There are cases when after this change, you will be no longer able to access your website (including the administration) through or

Possible issue with the DNS records

Every time when we hit, the request initiated by your web browser will be sent to the nearest DNS server whose job is to forward the request to the IP address of the server where you host your website. But there might be cases when the DNS server misses the information about what to do when somebody requests the domain name with WWW, example: Therefore it cannot redirect non-WWW to WWW URL. From DNS point of view, this is a different domain name and if there is no record for it, it couldn’t know where to forward the request.

Set up a DNS record

Open the administration of your domain name (, GoDaddy, or else) and add the following CNAME record:

Hostname: *
Target Host:

This CNAME record is called a Wildcard record because what it does is to tell the DNS servers to forward all requests regarding to the IP address associated with the domain name


Here are a few things to consider checking:

If you need assistance with WordPress or your website, contact me.

(The header image is taken from DigitalOcean website.)