fbpx

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

Description

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

example.com

to

www.example.com

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 example.com to www.example.com (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 example.com or www.example.com.

Possible issue with the DNS records

Every time when we hit example.com, 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: www.example.com. 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 (Name.com, GoDaddy, Domain.com or else) and add the following CNAME record:

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

Additional

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

Whenever you're ready, here's how I can help you:


1. Develop your Product: Want to start, maintain, and grow your tech business? Our team of senior software engineers at Camplight can help.

A team of +50 employee members and +1500 pre-vetted experts. We have delivered 300+ projects, handled 1200+ consultation requests, gained expertise in 4 key industries. We can manage budget scopes ranging from $1k to $800k+.

​Read more

or

Contact Camplight

2. Join Our Finder’s Fee Program: Refer a client and earn a 10% finder’s fee.

Do you know someone who needs a reliable software development partner to build and grow their product and venture?

At Camplight, we excel in delivering results and innovation for well-funded startups and established businesses, boasting a 95% recommendation rate from our clients.

​Email Our Team at Camplight to Learn More